A Short and SIMPLE HTML Web Scraper in 6 lines of CODE

preview_player
Показать описание
Just a fun video where I thought I'd see how few lines of code I could write to get a functional web scraper. I chose Python and Requests-HTML as it is both the extract and transform (download and parse) parts all in one and I much prefer using CSS selectors these days for HTML parsing. The website had to be HTML and i was going to get 2 points of data from the main page. Sometimes it's nice just to write some short code snippets and who knows maybe this will help someone out!

If you wish to Support me:

-------------------------------------
Disclaimer: These are affiliate links and as an Amazon Associate I earn from qualifying purchases
-------------------------------------
Рекомендации по теме
Комментарии
Автор

Could you have done better? let me know!

JohnWatsonRooney
Автор

I like to create schemas or models with yaml and there organize all the selectors and the extraction method.

coxinitus
Автор

I was trying any method of web scraping, but yours is awesome. Thanksss btw 🔥🔥🔥🔥

katadayat
Автор

Thanks for the quality content always, John. 😋

pahehepaa
Автор

Thanks John, quality as always!
I was saying to myself at 5:00 "Why not use list comprehension to save a line?" ... then you did 😅

decromax
Автор

Can you make a video to scrape products from a Shopify store

freakymonster
Автор

Hi, thanks for this video. Can you do a video on how to extract details from iframe please. I was trying to extract iframe details from a page in indeed but I couldn’t do it. Can it done using BeautifulSoup or Scrapy? Thanks for all your videos.

sriram-uuyd
Автор

I manage to do it in 6 lines with requests and bs4 and also 4 lines but not better code than you're.
I posted two Pastebin links but the comment get erased.. I don't know if it is against YT rules?
🤔

uwtdtv