按老師的框架,嘗試用requests庫,做了一個爬取簡書文章內(nèi)的圖片^_^
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的鏈接')部分出現(xiàn)問題,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