Skip to content
Advertisement

Tag: beautifulsoup

Python Beautiful Soup html.parser returns none

I have a feeling the information is somewhere on stack overflow, but I can’t find it :-/ I’m looking to get the text from this website: https://www.uniprot.org/uniprot/P28653.fasta but my code returns ‘None.’ All help is super appreciated! returns Thanks!! Answer There is no html in the site. You can just print r.content directly (however, I prefer r.text as it is

Beautiful Soup and requests problem it doesn’t show any text output

I am using beautiful soup and requests to print full text of the article of this wedsite https://www.vanityfair.com/style/society/2014/06/monica-lewinsky-humiliation-culture This is my code: My code run without any error but it does’t show any text in output plz help me find my error Answer What happens? You try to find_all() div tags with two classes that do not exists, so match

BeautifulSoup choosing a line from output

I try to make a python script that gets the dam occupancy rates from a website. Here is the code: The output is like this: Genel Doluluk Oranı means occupancy rate. I need the value of occupancy rate which writes in next line like 29,48. How can I get this value from output? Answer Cause question and expected result is

Struggling with BeautifulSoup and tags

I hate to trouble anyone with this, but I’ve been on this issue for days. Basically, I want to scrape the Psychological Torture Methods from this web page: https://en.m.wikipedia.org/wiki/List_of_methods_of_torture This is the exact information I would like to acquire: Ego-Fragmentation Learned Helplessness Chinese water torture Welcome parade (torture) And below is my code: I’m sure there is an easy fix

Can’t get tags when scraping data

I am trying to scrape all tr tags using BeautifulSoup, but it returns none. Code: Even though there are tr tags in this url, it returns none and throws an IndexError. Why is this happening? Answer In page source table is located inside comment. You need to extract comment content and then parse it as HTML:

Getting no data when scraping a table

I am trying to scrape historical data from a table in coinmarketcap. However, the code that I run gives back “no data.” I thought it would be fairly easy, but not sure what I am missing. Output: Answer You don’t need to scrape the data, you can get request it: Output:

Advertisement