web-scraping

Find a tag using text it contains using BeautifulSoup

荒凉一梦 提交于 2021-02-20 05:16:37
问题 I am trying to webscrape some parts of this page: https://markets.businessinsider.com/stocks/bp-stock using BeautifulSoup to search for some text contained in h2 title of tables when i do: data_table = soup.find('h2', text=re.compile('RELATED STOCKS')).find_parent('div').find('table') It correctly get the table I am after. When I try to get the table "Analyst Opinion" using the similar line, it returns None: data_table = soup.find('h2', text=re.compile('ANALYST OPINIONS')).find_parent('div')

Find a tag using text it contains using BeautifulSoup

删除回忆录丶 提交于 2021-02-20 05:16:06
问题 I am trying to webscrape some parts of this page: https://markets.businessinsider.com/stocks/bp-stock using BeautifulSoup to search for some text contained in h2 title of tables when i do: data_table = soup.find('h2', text=re.compile('RELATED STOCKS')).find_parent('div').find('table') It correctly get the table I am after. When I try to get the table "Analyst Opinion" using the similar line, it returns None: data_table = soup.find('h2', text=re.compile('ANALYST OPINIONS')).find_parent('div')

How to get HTML element that is before a certain class?

大憨熊 提交于 2021-02-20 04:30:28
问题 I'm scraping and having trouble getting the element of the “th” tag that comes before the other “th” element that contains the “type2” class. I prefer to take it by identifying that it is the element "th" before the "th" with class "type2" because my HTML has a lot of "th" and that was the only difference I found between the tables. Using rvest or xml2 (or other R package), can I get this parent? The content which I want is "text_that_I_want". Thank you! <tr> <th class="array">text_that_I

How to get HTML element that is before a certain class?

给你一囗甜甜゛ 提交于 2021-02-20 04:29:20
问题 I'm scraping and having trouble getting the element of the “th” tag that comes before the other “th” element that contains the “type2” class. I prefer to take it by identifying that it is the element "th" before the "th" with class "type2" because my HTML has a lot of "th" and that was the only difference I found between the tables. Using rvest or xml2 (or other R package), can I get this parent? The content which I want is "text_that_I_want". Thank you! <tr> <th class="array">text_that_I

BeautifulSoup isn't working while web scraping Amazon

老子叫甜甜 提交于 2021-02-20 04:13:09
问题 I'm new to web scraping and i am trying to use basic skills on Amazon. I want to make a code for finding top 10 'Today's Greatest Deals' with prices and rating and other information. Every time I try to find a specific tag using find() and specifying class it keeps saying 'None'. However the actual HTML has that tag. On manual scanning i found out half the code of isn't being displayed in the output terminal. The code displayed is half but then the body and html tag do close. Just a huge

Android app, how to log into website and display information?

北慕城南 提交于 2021-02-20 04:09:38
问题 I'm trying to build an android app that will log into a website, scrape the website for data specific to the user, then format that data nicely on a mobile screen. I've noticed that there are several similar questions to my own, and after reading some of the documentation, I am still very confused as to how I should go about this. Here's what I know The site that I want to log into utilizes asp.net and the login.aspx uses POST for the login form. There is no API for this website There is also

Android app, how to log into website and display information?

 ̄綄美尐妖づ 提交于 2021-02-20 04:08:48
问题 I'm trying to build an android app that will log into a website, scrape the website for data specific to the user, then format that data nicely on a mobile screen. I've noticed that there are several similar questions to my own, and after reading some of the documentation, I am still very confused as to how I should go about this. Here's what I know The site that I want to log into utilizes asp.net and the login.aspx uses POST for the login form. There is no API for this website There is also

Android app, how to log into website and display information?

老子叫甜甜 提交于 2021-02-20 04:07:22
问题 I'm trying to build an android app that will log into a website, scrape the website for data specific to the user, then format that data nicely on a mobile screen. I've noticed that there are several similar questions to my own, and after reading some of the documentation, I am still very confused as to how I should go about this. Here's what I know The site that I want to log into utilizes asp.net and the login.aspx uses POST for the login form. There is no API for this website There is also

Excel VBA Web Scraping Table Elements from a <frameset> and a <frame>

你。 提交于 2021-02-20 03:36:15
问题 I am trying to scrape some table-looking items from a website into Excel. I'm no stranger to coding in general, though I'm pretty new to VBA in an Excel sense :) I have tried using Excel's Data>From Web interface, it's not recognizing the table. I'm guessing it's because it's built using (or at least that's what my Google-Fu has lead me to understand). Snipping of what the second table looks like <html> <frame title="links" ...>...</frame> <frame title="queue"> #document <head>...</head>

Excel VBA Web Scraping Table Elements from a <frameset> and a <frame>

試著忘記壹切 提交于 2021-02-20 03:35:54
问题 I am trying to scrape some table-looking items from a website into Excel. I'm no stranger to coding in general, though I'm pretty new to VBA in an Excel sense :) I have tried using Excel's Data>From Web interface, it's not recognizing the table. I'm guessing it's because it's built using (or at least that's what my Google-Fu has lead me to understand). Snipping of what the second table looks like <html> <frame title="links" ...>...</frame> <frame title="queue"> #document <head>...</head>