-
学习beautifulsoup,并使用beautifulsoup提取内容。
-
使用beautifulsoup提取丁香园论坛的回复内容。
#连接网站
response=opener.open("http://www.dxy.cn/bbs/thread/626626#626626")
sHtml=response.read().decode('utf-8')
print(sHtml)
print('Code:',response.status)
-
学习xpath,使用lxml+xpath提取内容。
-
使用xpath提取丁香园论坛的回复内容。
#连接网站
http://www.dxy.cn/bbs/thread/626626#626626
response=opener.open("")
sHtml=response.read().decode('utf-8')
print(sHtml)
print('Code:',response.status)