想请教版上的专家,有先搜寻资料了,但还是爬不了新闻内文,故想请教
目前想要把新闻内文爬进来
https://reading.udn.com/read/story/122749/6680114
网页程式如下
https://i.imgur.com/eYufIAY.png
目前程式到这一步卡住,一直抓不到内文,故要请教各位专家该怎么调整
,谢谢。
for a in soup.select('div.story-list__news div.story-list__text h2 a '):
list_news.append(a['href'])
print (list_news)
for index, link in enumerate(list_news):
res = req.get(link)
soup_ = bs(res.text, "lxml")
print(soup_.select_one('article.article-content
div.article-content__paragraph section.article-content__editor
div.inline-ads ').get_text())
print("=" * 50)