Web Scraping Tutorial with Python Beautiful Soup | Scraping Graphic Cards | Community Webinar

Data Science Dojo · 1.5M views · 2017 · 33:31

Open on YouTube

Python, Ruby & scripting languagesWeb developmenttutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as the tutorial they followed when learning Beautiful Soup, usually when their own scraper copied from it throws errors or returns empty results.

Recommended by 4 people across 4 different months, 2017 to 2020.

What it is

A 33-minute hands-on tutorial from Data Science Dojo that builds a Python web scraper with urllib and Beautiful Soup. It scrapes graphics card listings from NewEgg.com and writes them to a CSV file, with timestamps for each step from setup to final output.

What people said

Recommends HonsTh · 2019-07 · Stack Overflow · on “How to make a loop to extract text from hyperlinks in a webpage”

I'm still quite new to python and trying to use it for webscraping. Specifically, I want to get all the quotes on this page [LINK] , that are given here: "XXX full quotes by YYY" or in the case there's only one quote: "the full quote by YYY". After getting the text on each page, I want to have them saved as a separate text file. I've been following this tutorial [this video] , but I'm a little confused in terms of how to filter the html? Honestly, I have barely any experience with HTML so it's a little hard to navigate what it means, but I THINK, the section of interest is this: <a href="javascript:pop('../2020/ Here's my code so far, to open the webpage. import bs4 from urllib.request import Req

Recommends Emma Felgate · 2020-04 · Stack Overflow · on “Web Scraping the contents of a tittle attribute”

I am following along a tutorial on how to use Beautiful Soup to program a web scraper. [this video] Here is the tutorial with a timestamp to my roadblock. All was going well, I managed to get the brand name and save it to a variable. However when It came to getting the item name, I don't know If I diverged from the tutorial or if the structure of the site has changed but I can't do it. Here is my code: from urllib.request import urlopen as uReq from bs4 import BeautifulSoup as Soup my_url = ' [LINK] ' #Opening conection, grabbing page uClient = uReq(my_url) #offloads contents into variable page_html = uClient.read() #closes connection uClient.close() #html parsing page_soup = Soup(page_html, "htm

Recommends Sean Blumenfeld · 2020-05 · Stack Overflow · on “Error in python web scraper wont run properly”

from urllib.request import urlopen as uReq from bs4 import BeautifulSoup as soup my_url = ' [LINK] ' # opening up connection, grabbing the page uClient = uReq(my_url) page_html = uClient.read() uClient.close() #html parsing page_soup = soup(page_html, "html.parser") #grabs each product containers = page_soup.findAll("div", {"class":"item-container"}) for container in containers: brand = container[0].img["title"].title() title_container = container.findAll("a", {"class":"item-title"}) product_name = title_container[0].txt shipping_container = container.findAll("li", {"class":"price-ship"}) shipping = shipping_container[0].text.strip() print("Brand: "+ brand) print("product name: "+ product_na

Recommends bimmui · 2020-08 · Stack Overflow · on “Using BeautifulSoup to get text from <pre> element”

I've been trying to extract the DNA sequence from this site [LINK] but I can't seem to access the data. My code is shown below. If it's any help, I was also following this tutorial [this video] on data scraping and the beginning of my code should seem similar to theirs. from urllib.request import urlopen as uReq from bs4 import BeautifulSoup as bslol # URl to web scrape from page_url = ' [LINK] ' # opens the connection and downloads html page from url uClient = uReq(page_url) # parses html into a soup data structure to traverse html # as if it were a json data type. page_soup = bslol(uClient.read(), "html.parser") uClient.close() To get the text, I first tried using print(page_soup.select('pre'))

Cites Tudor Ozy · 2017-08 · Stack Overflow · on “Trying to scrape this page with python but returns gibberish”

I tried this tutorial from here: [this video] And this is the script which I am trying to scrape a steemit post: [LINK] from urllib.request import urlopen as uReq from bs4 import BeautifulSoup as soup my_url = ' [LINK] ' uClient = uReq(my_url) page_html = uClient.read() uClient.close() page_soup = soup(page_html,'html.parser') print(page_soup.prettify("utf-8")) currently the code is outputting gibberish. I don't know how to get the pure html source. What am I doing wrong ? :(

Cites agccaesar · 2017-08 · Stack Overflow · on “I can print the result but it doesn't appear on my CSV file after scraping”

I am a beginner to python and scraping, so I still have some difficulties to scrape a simple table, which is hosted on this website [ [LINK] . I have been following a tutorial on YouTube [ [this video] , but since this website seems easier to scrape, the steps don't match with the ones on the video. For now, my code is able to print the "td" (the content inside the table), but the file "concurso.csv" is empty. I ain't sure what I've done wrong. I appreciate some help. My question linked by @coldspeed as duplicated doesn't clarify my doubt – it could be other's too. I've already googled a lot about the reason why my script doesn't work. It's unfair to close my question without any reason. @coldspe

Cites furas · 2017-11 · Stack Overflow · on “How to Web Scrape Youtube Comments using BeautifulSoup?”

I found it read comments from ` [LINK] but it gives error 403 if you try to download without coockies which you would get from [this video] so it more complex than on other web pages. Using Selenium it should be easier.

Cites Zegarek · 2017-11 · Stack Overflow · on “Selenium python types of content loading constraints”

If it's just parsing the text content that you're after, you might consider using just Python and BeautifulSoup [this video] . You shouldn't be triggering anything in the browser this way since you won't use one at all (you mentioned you don't need windows opening) and at the same time the solution will be faster lacking that browser overhead. If you do need some javascript loaded, you can try using dryscape [LINK] as well.

Cites Rip_027 · 2018-02 · Stack Overflow · on “Python BS4 share info not showing”

Good morning everyone I have recently started using BeautifulSoup and watching videos and reading up on it with the intention of web scraping share price information daily and add this to a previously populated csv file that contains historical share prices. I have tried several amendments to my code (below) and regardless of whether I use the "div" or "span" element and then add the full class name - I end up receiving empty brackets "[]" as my print in the console. The site I was using is yahoo finance - so I tried using another site, Sharenet, also the same problem. I then tried scraping another part of the website (the share name only) - also empty brackets. The only time I receive a res

Cites Bryead · 2019-05 · Stack Overflow · on “Error in web-Scraping Code Using BeautifulSoup”

I want to get data from [LINK] from page 1 to the last page while it is sorted by "CVE Number Ascending" The data I want to retrieve in CSV format is everything in the table header and the table data I have been trying out a few codes but it doesn't seem to work and I'm kind of desperate now [this video] the place I try to learn from Any help would be appreciated I asked this once before The replies I got were great But it doesn't seem to get what I need and I am confused about how this works And more so because of how weird the sources code for the website is #!/usr/bin/env python3 import bs4 # Good HTML parser from urllib.request import urlopen as uReq # Helps with opening URL from bs4 import B