Python 爬虫学习日记(一)
爬取百度链接
其对链接中关键词wd进行了url编码,url中pn可以改变页面
详细内容在链接:
https://blog.csdn.net/qq_41453482/article/details/100608870
关键代码:
import urllib.parse
key={‘wd’:‘B站’}
key=urllib.parse.urlencode(key)
print(key)
wd=B%E7%AB%99
百度搜索URL参数含义:https://blog.csdn.net/ljn113399/article/details/52395695
BeautifulSoap用法:
soap = BeautifulSoup(HTML.content, ‘html.parser’)
F12,打开页面进程
a标签下有百度链接的url,在href中
Html中
“点击开始”
相当于word中设置超链接,在“点击开始”下隐藏一个链接,链接内容是href中的内容