Python 크롤러에서 발생하는 문제(모바일 Taobao의 모든 사용자에게 문의)
大家讲道理
大家讲道理 2017-05-18 10:49:35
0
1
820

我在获取手淘问大家 网页源码的时候 没有关键内容 不知道是哪里错了 请大神指点我

代码如下

import requests import sys import re import pandas import xlwt reload(sys) sys.setdefaultencoding('utf-8') agent = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.104 Safari/537.36 Core/1.53.2263.400 QQBrowser/9.5.10388.400', 'Referer':'https://h5.m.taobao.com/wendajia/question.htm?wdjType=1&spm=w-a2141.7631564&itemId=543177969359&ttid=600000%40taobao_android_6.7.3&sourceType=other&suid=c1f2e696-6d34-4b70-8b06-799e0b0e0318&ut_sk=1.VfQZetSloEcDAHYQ1EoMp2Tt_21646297_1494467551850.TaoPassword-WeiXin.windvane&cpp=1&shareurl=true&short_name=h.TzZu7m&cv=YpJRZGEjhKo&sm=64172f&app=chrome', 'Upgrade-Insecure-Requests':'1', } url = 'https://h5.m.taobao.com/wendajia/question-answer.htm?topicId=90187486618&spm=a3134.7874262.1.i3' content = requests.get(url,headers=agent) print content.text

结果:

C:\Python27\python.exe E:/donggu_python/test.py     问题详情