Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
parsing comment tag
#1
I am trying to parse a webpage with python 3.6.2 with BeautifulSoup4.
What I need is to retrieve the text of news headlines that are in comment tags (<!-- .. -->). such as on https://ca.finance.yahoo.com/quote/GOOG/news?p=GOOG
Are there any sample codes ? Thanks.
Reply
#2
What have you tried?

Here a hint <!-- react-text: 226 -->
So news are generated be JavaScript using React.
Can BeautifulSoup alone parse JavaScript?
The answer is no Hand

Search this forum for Selenium,
there are many examples using it alone or together with BeautifulSoup.
Reply
#3
You should take a look at: http://meumobi.github.io/stocks%20apis/2...e-api.html
Especially the legal parts. Looks like it's OK to extract the dta so long as it's not for commercial use., but not otherwise.
But it does give some basic information on extracting what you are interested in.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help me make a comment on youtube caarsonr 14 6,070 Jun-23-2019, 02:56 AM
Last Post: metulburr

Forum Jump:

User Panel Messages

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