Python Forum
Web Scraping Inquiry (Extracting content from a table in asubdomain)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Web Scraping Inquiry (Extracting content from a table in asubdomain)
#3
This code gets me the first link:

import requests
from bs4 import BeautifulSoup

# Get info from main site
url = 'https://mattrode.com/blog/robinhood-collections-list/'
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36'}
response = requests.get(url, headers=headers)
soup = BeautifulSoup(response.content, 'lxml')
ol_tag = soup.find('ol')
li_tag = ol_tag.find('li')
link = li_tag.a.get('href')
print(link)
How do I go about going into the link to extract the stock ticker symbol?
Reply


Messages In This Thread
RE: Web Scraping Inquiry (Extracting content from a table in asubdomain) - by DustinKlent - Aug-17-2020, 03:35 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Scraping links and table from link cartonics 11 1,687 Oct-12-2023, 06:42 AM
Last Post: cartonics
  Scraping data from table into existing dataframe vincer58 1 2,044 Jan-09-2022, 05:15 PM
Last Post: vincer58
  Scraping the page without distorting content oleglpts 5 2,519 Dec-16-2021, 05:08 PM
Last Post: oleglpts
  Python Web Scraping can not getting all HTML content yqqwe123 0 1,656 Aug-02-2021, 08:56 AM
Last Post: yqqwe123
  Need help scraping wikipedia table bborusz2 6 3,284 Dec-01-2020, 11:31 PM
Last Post: snippsat
  Scraping a dynamic data-table in python through AJAX request filozofo 1 3,910 Aug-14-2020, 10:13 AM
Last Post: kashcode
  scraping multiple pages from table bandar 1 2,727 Jun-27-2020, 10:43 PM
Last Post: Larz60+
  BeautifulSoup: Error while extracting a value from an HTML table kawasso 3 3,275 Aug-25-2019, 01:13 AM
Last Post: kawasso
  Web scraping User Generated Content StephenG93 2 2,977 Oct-10-2018, 12:17 AM
Last Post: StephenG93
  Web scraping "fancy" table acehole60 2 4,941 Dec-16-2016, 09:17 AM
Last Post: acehole60

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020