热门搜索 :
考研考公
您的当前位置:首页正文

github访问慢解决方案(转)

来源:东饰资讯网

问题原因

解决方法

windows C:\Windows\System32\drivers\etc\hosts
linux /private/etc/hosts
修改hosts主机映射文件:
添加github一系列网址的IP地址、域名映射












github.io

然后用python语言使用requests+beautifulsoup制作一个小爬虫

import requests
from bs4 import BeautifulSoup

for i in open("haha.txt"):
    url =  + i.strip()
    resp = requests.get(url)
    soup=BeautifulSoup(resp.text)
    x=soup.find(class_="IcpMain02")
    x=x.find_all("span",class_="Whwtdhalf")
    print(x[5].string.strip(),i.strip())

关闭浏览器,重新打开,就能体验到飞一般的感觉 !

Top