
本文共 3677 字,大约阅读时间需要 12 分钟。
���������������������������
������������������������
���������������������������������������������������������������������������������������������������������������������������������������������Top250������������������������������������������������������������������
URL���������
������������������Top250���������https://movie.douban.com/top250������������������URL���������������������������������URL���������������������������������start���������������������-1�����25���������������������������������start������������������������������������������������������������������
������������������F12������������������������������headers������������������������������������������������������������������������User-Agent������������������������������Python���������User-Agent���������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������
������������������Regular Expression������
���Python������������������re
���������������������������������������������<a href="(.*?)">
��������������������������������������������� XPath���XML Path Language������
���������������XML���������������������������������������������������������������������������������������HTML���������������BeautifulSoup���������BS4������
���������������������HTML���������������������������������������������DOM������������������������������������������.find()
���.find_all()
��������������������������������� ������������
������������������������������������������������������������
-
User-Agent���������
���������������User-Agent���������������������������������������User-Agent���������������������chrome://version/������������������User-Agent������������������������������������������������ -
���������������
������������������������������������������������������������������URL���������������������������������������������������������������������������������������������
������������������������������
������������������������������������������������������������������������
-
���������������
������BeautifulSoup������������������������������������������������������HTML������������������������find_all('div', class_='item')
���������������������������div��������� -
������������������
��������������������������������������������������������������������������������������������������������������������������������������������������� -
���������������
������������������������������datalist���������������Excel���CSV���������������������������������������������������urlretrieve()
������������������������������������������������������������������
���������������������
������������������������������������������������������������������������������������
-
���������������
������������������DataFrame������������������������������������������������������������������������������������������������������ -
������������������
������matplotlib���������������������������������������������������������������������������������������������������������������������������������������������
������������
���������������������������������������������������������
-
Excel���������
������������������������������CSV��������������������������������������� -
������������������
���������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
