GET.html?_ijt=5lik4i8at4b37jc5u4e9blkq6c:32 GET http://127.0.0.1:8080/server net::ERR_CONNECTION_REFUSED
时间: 2023-12-06 17:41:48 浏览: 132
这个错误表示你的浏览器正在尝试连接到本地主机(127.0.0.1)的8080端口,但服务器拒绝了连接。可能有以下几个原因:
1. 服务器没有启动或已经停止。请确保你的服务器正在运行并监听8080端口。
2. 防火墙阻止了连接。请检查你的防火墙设置,确保允许浏览器连接到8080端口。
3. 你的服务器在不同的IP地址或端口上运行。请确认你的服务器正在正确的IP地址和端口上运行。
你可以根据具体情况,去排查以上可能的原因。
相关问题
import requests from lxml import etree import csy headers = { User-Agent’: 'ozilla/5.0 (Windows NT 10.0: WOW64) ppleWebKit/537.36 (KHTL,lik f = open('益智.csy’, mode='w’, encoding='utf-8-sig’, newline=’csv_writer = csv.DictWriter(f,fieldnames=[,游戏名称’,’游戏地址’])csy_writer.writeheader. for i in range(1,123): fi= 1: wrl = 'https ://ww.4399.com/flash fl/5 1.htm' html = requests.get(url,headers=headers].content doc = etree.HTML(html)name = doc.xpath('//* [@class="list affix cf~]/li/a/text()')url 1 = doc.xpath('//*[@class=~list affix cf]/li/a/@href')#data {ist = for i in range(len(name)) : dit = 4 dit[’游戏名称’] = name [i]new_url ='https://u.4399.com’ + url 1[i]for id in new l:dit[’游戏地址’] = id #data list append(dit) csy writer.writerowidit] else: wrl = 'https://wuw.4399.com/flash fl/more 5 .htm'.format(str(i))html = requests.get(url,headers=headers].content doc = etree.HTL(html) name = doc.xpath('//*[@class=~list affix cf~]/li/a/text()')url 1 = doc.xpath('//*[@class=list affix cf~]/li/a/@href') for i in range(len(name)) : dit =几 dit[’游戏名称’] = name[i] new_url ='https://www.4399.com’ + wrl 1[il for id in new url: dit[’游戏地址’] = id #data jist aopendidit! csv_writer.writerow(dit) #orintidata fist! print(name,id)爬取重复
这段代码存在一些明显的错误,如缺少冒号、引号不匹配、缩进错误等。以下是修复后的代码:
```python
import requests
from lxml import etree
import csv
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'}
with open('益智.csv', mode='w', encoding='utf-8-sig', newline='') as f:
csv_writer = csv.DictWriter(f, fieldnames=['游戏名称', '游戏地址'])
csv_writer.writeheader()
for i in range(1, 123):
if i == 1:
url = 'https://www.4399.com/flash_fl/51.htm'
else:
url = 'https://www.4399.com/flash_fl/more_5_{}.htm'.format(str(i))
html = requests.get(url, headers=headers).content
doc = etree.HTML(html)
name = doc.xpath('//*[contains(@class, "list") and contains(@class, "affix") and contains(@class, "cf")]/li/a/text()')
url1 = doc.xpath('//*[contains(@class, "list") and contains(@class, "affix") and contains(@class, "cf")]/li/a/@href')
for i in range(len(name)):
data = {}
data['游戏名称'] = name[i]
new_url = 'https://www.4399.com' + url1[i]
for id in new_url:
data['游戏地址'] = id
csv_writer.writerow(data)
print(data)
```
需要注意的是,这段代码仍然存在一些问题,如 URL 的构造方式不太正确,以及数据的写入可能会存在覆盖的情况。你需要进一步检查和调整代码以确保其正确性。
Building Library\Bee\artifacts\Android\87lik\ho6i_data0.lump.o failed with output: In file included from Library/Bee/artifacts/Android/87lik/jfwz_metadata0.lump.cpp:3: In file included from F:/MyWorkProject/UnityEditorProjectTest/HybridCLRData/LocalIl2CppData-WindowsEditor/il2cpp/libil2cpp/metadata/CustomAttributeDataReader.cpp:11: In file included from F:/MyWorkProject/UnityEditorProjectTest/HybridCLRData/LocalIl2CppData-WindowsEditor/il2cpp/libil2cpp\hybridclr/metadata/MetadataUtil.h:10: In file included from F:/MyWorkProject/UnityEditorProjectTest/HybridCLRData/LocalIl2CppData-WindowsEditor/il2cpp/libil2cpp\hybridclr/metadata/../CommonDef.h:7: F:\MyWorkProject\UnityEditorProjectTest\HybridCLRData\LocalIl2CppData-WindowsEditor\il2cpp\libil2cpp\hybridclr\Il2CppCompatibleDef.h(25,2): error: "not suppport unity version" #error "not suppport unity version" ^ F:\MyWorkProject\UnityEditorProjectTest\HybridCLRData\LocalIl2CppData-WindowsEditor\il2cpp\libil2cpp\hybridclr\Il2CppCompatibleDef.h(264,2): error: "not support unity version" #error "not support unity version" ^ In file included from Library/Bee/artifacts/Android/87lik/jfwz_metadata0.lump.cpp:3: In file included from F:/MyWorkProject/UnityEditorProjectTest/HybridCLRData/LocalIl2CppData-WindowsEditor/il2cpp/libil2cpp/metadata/CustomAttributeDataReader.cpp:11: In file included from F:/MyWorkProject/UnityEditorProjectTest/HybridCLRData/LocalIl2CppData-WindowsEditor/il2cpp/libil2cpp\hybridclr/metadata/MetadataUtil.h:10: F:\MyWorkProject\UnityEditorProjectTest\HybridCLRData\LocalIl2CppData-WindowsEditor\il2cpp\libil2cpp\hybridclr\CommonDef.h(19,10): fatal error: 'icalls/mscorlib/System/MonoType.h' file not found #include "icalls/mscorlib/System/MonoType.h" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 errors generated. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)什么问题?
这是一个编译错误,看起来是你的代码中的某些文件无法找到或不兼容 Unity 版本所导致的。具体而言,错误信息指出了两个 #error 指令,提示当前 Unity 版本不支持。还有一个致命错误,指出找不到 'icalls/mscorlib/System/MonoType.h' 文件。
你可以尝试以下几个步骤来解决这个问题:
1. 确认你的代码是否与 Unity 版本兼容,如果不兼容,需要更新代码或降级 Unity 版本。
2. 确认 'icalls/mscorlib/System/MonoType.h' 文件是否存在,如果不存在,需要检查代码中是否有错误的路径或文件名拼写错误。
3. 检查代码依赖项是否正确配置,包括头文件路径、库文件等。
4. 如果以上步骤都没有解决问题,请尝试重新构建项目或清除构建缓存。
希望这些步骤能够帮助你解决问题。
阅读全文