Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

web_scrapping.py 523 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  1. #Web Scrapping All Links With Python
  2. from bs4 import BeautifulSoup
  3. import requests
  4. URL = "https://finance.yahoo.com/quote/AAPL?p=AAPL&.tsrc=fin-srch"
  5. page = requests.get(URL)
  6. soup = BeautifulSoup(page.content, 'html.parser')
  7. for link in soup.find_all('a', href = True):
  8. print (link.get('href'))
  9. URL = "https://finance.yahoo.com/news/true-value-always-prevails-against-technological-advancement-141902215.html"
  10. page2 =requests.get(URL)
  11. soup = BeautifulSoup(page2.content, 'html.parser')
  12. print(soup.text)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...