想請教版上的專家,有先搜尋資料了,但還是爬不了新聞內文,故想請教
目前想要把新聞內文爬進來
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)