Skip to content

Tag: beautifulsoup

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…

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 Helpless…

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: