源码:import requests
headers = {‘User-Agent’: ‘Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.0.1) Gecko/20021104 Chimera/0.6’,
}
url = ‘https://feed.mix.sina.com.cn/api/roll/get?pageid=153&lid=2509&k=&num=50&page=1’
resp = requests.get(url,headers=headers)
print(resp.status_code)
url是新浪新闻json格式异步加载的新闻信息,在window上可以正常爬和解析,在Linux上爬取就报错403.但是新浪明明没用反爬。
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
把自己的完整 tcp 字节码打出来对比不就知道了。
试了一下用curl都能访问到这个链接,是不是你的linux的ip有问题。