Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from bs4 import BeautifulSoup
- res = requests.get("https://reading.udn.com/read/story/122749/6680114")
- soup = BeautifulSoup(res.text, "html.parser")
- list_news = []
- for i in soup.select(".story-list__news .story-list__title a"):
- list_news.append(f"https://reading.udn.com{i.get('href')}")
- print(list_news)
- for link in list_news:
- link_res = requests.get(link)
- link_soup = BeautifulSoup(link_res.text, "html.parser")
- print(link_soup.select(".article-content__editor"))
- print("=" * 50)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement