Skip to content
Advertisement

Tag: beautifulsoup

get a list from html source using python3

I am trying to get Cases list of COVID-19 positive cases from https://www.worldometers.info/, e.g. this The sample looks like(~line no: 700) : I am using bs4 as: which does scrape the file, but after that I am clueless how to get the data. The list I am looking for is commented with ## I NEED THIS LIST. Kindly help. Answer

Web Scraping find not moving on to next item

Usage of this is to sum up all the different kinds of items sold in kijiji and pair them up with a price. But I can’t seem to find anyway to increment what beautiful soup is finding with a class of price, and I’m stuck with the first price. Find_all doesn’t work either as it just prints out the whole

Taking multiple prices on single page BS4

I’m creating an to help me learn but is also useful to me. I want to be able to parse multiple prices from (https://www.watchfinder.co.uk/search?q=114060&orderby=AgeNewToOld) one page, convert them to numbers and average them. The page will change so it could have 3 prices one day and 20 the next. The part i am struggling with is separating the prices so

How to remove quote (‘) from the my scraped output

How can i get rid of the quotes in the output. I have tried to used .strip(”) but the output does not seem to change. The current output looks like this: [‘ADANIPORTS.NSn’, ‘ASIANPAINT.NS’, ‘AXISBANK.NS’, ‘BAJAJ-AUTO.NS’, ‘BAJFINANCE.NS’, ‘BAJAJFINSV.NS’, ‘BHARTIARTL.NS’, ‘INFRATEL.NS’, ‘BPCL.NS’, ‘CIPLA.NS’, ‘COALINDIA.NS’, ‘DRREDDY.NS’, ‘EICHERMOT.NS’, ‘GAIL.NS’, ‘GRASIM.NS’, ‘HCLTECH.NS’, ‘HDFC.NS’, ‘HDFCBANK.NS’, ‘HEROMOTOCO.NS’, ‘HINDALCO.NS’, ‘HINDUNILVR.NS’, ‘BRITANNIA.NS’, ‘ICICIBANK.NS’, ‘INDUSINDBK.NS’, ‘INFY.NS’, ‘IOC.NS’, ‘ITC.NS’, ‘JSWSTEEL.NS’, ‘KOTAKBANK.NS’,

Extract two div tags in one BS find_all

Is it possible to extract two HTML div tags in one “soup.find_all” with beautifulSoup? The divs are repeatedly called “event odd”, “event even” and i want to loop through them all webpage code: My code: concerts = soup.find_all([‘div’, {‘class’: ‘event odd’}, {‘class’: ‘event even’}]) Answer You can use Bitto Bennichan’s suggestion of using {‘class’: ‘event’}. Or, if you must specify

Advertisement