84669 Lernen von Personen
152542 Lernen von Personen
20005 Lernen von Personen
5487 Lernen von Personen
7821 Lernen von Personen
359900 Lernen von Personen
3350 Lernen von Personen
180660 Lernen von Personen
48569 Lernen von Personen
18603 Lernen von Personen
40936 Lernen von Personen
1549 Lernen von Personen
1183 Lernen von Personen
32909 Lernen von Personen
我在做一只淘宝的爬虫,但是用的是香港的服务器,但是比较困惑:因为每次爬淘宝的首页时候,就自动给我跳转到香港淘宝~~导致源代码和内容都不一样~请问如果遇到这种情况要怎么处理呢?
简单来说,比如采集58同城如果我是泉州的,我想采集北京的,要怎么采集?
因为我用我的ip打开会总跳转到北京,但是直接想采集58首页的
?![图片上传中...]
ringa_lee
禁止重定向,以requests为例子:
r = requests.get('http://github.com/', allow_redirects=False) r.status_code # 302 r.url # http://github.com, not https. r.headers['Location'] # https://github.com/ -- the redirect destination
如果是想采集的北京的,就去打子城名,不过有PGTID保护
http://bj.58.com/?PGTID=0d000...
建义使用selenium
有时候服务器会根据你的ip对应的地理位置信息作重定向的,这个你除了找代理应该没有别的方法了。。
禁止重定向,以requests为例子:
如果是想采集的北京的,就去打子城名,不过有PGTID保护
http://bj.58.com/?PGTID=0d000...
建义使用selenium
有时候服务器会根据你的ip对应的地理位置信息作重定向的,这个你除了找代理应该没有别的方法了。。