按老师的框架,尝试用requests库,做了一个爬取简书文章内的图片^_^
https://github.com/heheddff/myPythonProcess.git
https://github.com/heheddff/myPythonProcess.git
2018-11-29
用python报错:
UserWarning: You provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored
需要删除【from_encoding="utf-8"】
UserWarning: You provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored
需要删除【from_encoding="utf-8"】
2018-11-27
使用python3
1、
from urllib import request as urllib2
import http.cookiejar
2、
所有的print语句后需要加()
3、
cj=http.cookiejar.CookieJar()
1、
from urllib import request as urllib2
import http.cookiejar
2、
所有的print语句后需要加()
3、
cj=http.cookiejar.CookieJar()
2018-11-27
用python3的话,最后一句改为link.name,link.get('href'),link.string
2018-11-06
python3版本 print('lacie的链接')部分出现问题,AttributeError: 'NoneType' object has no attribute 'name'
print('lacie的链接')
link_node = soup.find('a', href = 'http://example.com/lacie')
print(link_node.name, link_node['href'], link_node.get_text())
print('lacie的链接')
link_node = soup.find('a', href = 'http://example.com/lacie')
print(link_node.name, link_node['href'], link_node.get_text())
2018-11-01