摘要:
报错:ascii' codec can't decode byte 0xe5 in position 2877: ordinal not in range... 主要错误是上面最后一行的Unicode解码问题,网上搜索说是读取文件时使用的编码默认时ascii而不是utf8,导致的错误; 在代码中加上 阅读全文
摘要:
from urllib2 import urlopen from bs4 import BeautifulSoup # Get the next page url from the current page url def get_next_page_url(url): page = urlopen(url) soup_page = BeautifulSoup(page, 'l... 阅读全文
摘要:
Official webpage: https://www.crummy.com/software/BeautifulSoup/bs4/doc/#searching-the-tree Prettify() The prettify() method will turn a Beautiful Sou 阅读全文