只爬取了入口url就結(jié)束了,去掉try也一樣,沒(méi)有任何報(bào)錯(cuò),不知道啥情況啊啊啊
2019-06-13
只爬取了入口url就結(jié)束了,去掉try也一樣,沒(méi)有任何報(bào)錯(cuò),不知道啥情況啊啊啊
2019-06-13
只爬取了入口url就結(jié)束了,去掉try也一樣,沒(méi)有任何報(bào)錯(cuò),不知道啥情況啊啊啊
2019-06-10
python3的Request()對(duì)象沒(méi)有add_data方法呀,是改到哪里去了嗎,在線等,急
2019-06-10
終于搞定了 下載這里的代碼
https://github.com/lovefengruoqing/baike_spider
需要爬多少條數(shù)據(jù)在count= 這里改
運(yùn)行之后點(diǎn)index.html打開(kāi)瀏覽器就可以,而不是output.html
https://github.com/lovefengruoqing/baike_spider
需要爬多少條數(shù)據(jù)在count= 這里改
運(yùn)行之后點(diǎn)index.html打開(kāi)瀏覽器就可以,而不是output.html
2019-05-18
老師上課超棒?。。。⊥ㄋ滓锥矣锌蚣軋D?。。?!
2019-05-16
python2.0版本導(dǎo)入cookielib直接import cookielib
python 3.6 改成 http.cookiejar了
python 3.6 改成 http.cookiejar了
2019-05-16
urllib2 在 python3.x 中被改為urllib.request
2019-05-16
python2.7
第三種方法
print '第三種方法'
#import http.cookiejar
import cookielib
cj=cookielib.CookieJar()
opener=urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
urllib2.install_opener(opener)
response3=urllib2.urlopen(url)
print response3.getcode()
print response3.read()
print '\n\n\n\n\n'
print cj
第三種方法
print '第三種方法'
#import http.cookiejar
import cookielib
cj=cookielib.CookieJar()
opener=urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
urllib2.install_opener(opener)
response3=urllib2.urlopen(url)
print response3.getcode()
print response3.read()
print '\n\n\n\n\n'
print cj
2019-05-13