
Learn beginner-friendly web scraping with Python using requests, lxml, and Splash; master how web requests work, XPath and CSS selectors, and store data in CSV, JSON, or MongoDB.
Explore popular web scraping tools and frameworks, including Scrapy, Beautiful Soup, and Splash, and learn when to use requests, CSS selectors, XPath, and Selenium to extract data from JavaScript-rendered pages.
Install python 3.7.3, verify the version, and set up Visual Studio Code; create a virtual environment, install pip, and configure Python extensions for web scraping with lxml.
Discover how to optimize your viewing experience in this Udemy 101 lecture by adjusting playback speed, enabling captions and transcripts, choosing streaming quality, and providing honest reviews.
Learn how to ask questions in course q&a: choose current lecturer, check for questions, tag your issue, include full project code and screenshots, and write in English, French, or Arabic.
Learn how HTML converts into an element tree via the ElementTree object, with tags like p and a forming a hierarchical structure that mirrors the HTML document in Python.
Extract titles and list items from HTML with an element tree, using find and find_all, navigate paths like head/title and body/li, and clean text with strip.
Discover how to select and extract from HTML with XPath in lxml, replacing find with XPath, retrieving text with text() and //tag/text(), and cleaning results with map, strip, and join.
Learn to use css selectors with lxml to extract html elements for web scraping, including installing cssselect, converting the tree to an html element, and retrieving titles and links.
Explore XPath and CSS selectors for querying XML and HTML documents, covering tag, attribute, and position-based selections, with practical comparisons and downloadable cheat sheets.
Learn the fundamentals of CSS selectors, including tag, class, id, and attribute selectors such as data-identifier, and patterns for starts-with, ends-with, contains, plus descendant, direct child, adjacent, and nth-child selectors.
Master CSS selectors for web scraping: target tags, classes, IDs, attribute selectors, and substring matches, and understand combinators like space, >, +, and ~, plus nth-child.
Learn XPath fundamentals for web scraping, compare XPath with CSS selectors, and practice selecting elements, attributes, and text using contains, starts-with, ends-with, text(), and last().
Learn how to navigate the HTML tree with XPath, using the parent, ancestor, preceding, and preceding-sibling axes, plus the node() function for dynamic upward selection.
Navigate down the html tree with xpath, using child, following, following-sibling, descendant axes, and the node() function to select elements and their descendants for web scraping.
Master XPath: select elements with //div, filter by [@id], use position() with or and, contains; ends-with isn’t supported in XPath 1.0, and navigate axes like parent, ancestor, and child.
Analyze how the client and server exchange http requests and responses, focusing on get and post, to render web pages. Gain a view of the web workflow before scraping sites.
Learn how to fetch HTML markup with Python requests, inspect responses with status codes like 200 and 404, and choose between resp.text and resp.content for web scraping using LXML later.
Explore the differences between browser requests and Python requests, examine request and response headers with dev tools, and learn to set a user agent to avoid being blocked when scraping.
Identify and extract the book title, price, stock remaining, and product description from a mock website page using XPath expressions, browser inspection tools, and techniques like contains and following-sibling.
Build a Python3 web scraper by converting the response to an element, applying XPath to extract title, price, availability, and description, and package the data in a dictionary.
Learn two practical data cleaning approaches for web scraping: use regex to extract digits, and use Python functions with isdigit, filter, and join to obtain the stock.
Define Python functions to write scraped data to JSON and CSV files. Use json.dump to serialize dictionaries and csv.DictWriter with headers to create clean CSV output.
Learn to turn a scraping project into a command line app using Kleck and click decorators, with options for book and file name, default values, and auto-generated help.
Learn to scrape a cryptocurrency site with python3 using requests, extracting name, market cap, price, and 24-hour change, and disable JavaScript to view the static HTML before using Splash.
Scrape currency data by building XPath expressions to extract currency name, market cap, price, and percent change, handling multiple currencies and pagination with requests, lxml, and splash.
Master recursive pagination by detecting the next button with XPath, looping pages via requests, joining absolute URLs, handling errors, and saving scraped data to MongoDB.
Store scraped data in a MongoDB cloud database using Python and PyMongo; configure cluster, create a user, whitelist IPs, then insert data into currencies database.
Prevent duplicate records in mongodb by using the coin number as the id and updating entries when price, market cap, or 24-hour change differs.
Update XPath expressions to adapt to CoinMarketCap changes, disable JavaScript for testing, and extract coin number, name, market cap, price, and 24h change.
Explore the differences between api and html scraping by inspecting network requests, disabling javascript, and extracting product data from a site using xhr, post, and json payloads.
Learn to test and generate code for web APIs with Postman, including setting headers, choosing get or post, handling responses, and exporting Python requests code for automated scraping workflows.
Parse APIs with Python by retrieving JSON responses, iterating over products, and extracting id, display name, price, size, unit, and image to build absolute URLs.
Leverage recursion to scrap remaining products across pages by turning the code into a swapper function with a single page number argument defaulting to one, and a stop condition.
Test API behavior with an invalid page number to establish a stopping condition. Wrap the code in a try-except to return none on missing data during recursive scraping.
Learn to store products in a secure lightweight sqlite3 database by creating Walgreens.db, building a products table with a primary key, and inserting records with error handling.
Explore how Splash renders JavaScript-heavy pages with requests and how to write scripts and select elements. Grasp why requests cannot handle JavaScript and how Splash acts as a browser engine.
Set up splash using DOCA on a PC by configuring virtualization tools, disabling Hyper-V on Windows, installing Docker Toolbox, VirtualBox, and creating a fixed port for reliable access.
Explore Splash's user interface, render a webpage to capture a screenshot and the estimated markup, using a scripting language and wait logic to ensure resources load.
Automate Google searches with splash by locating the input with css selectors, filling it, and submitting via enter or clicking the search button, while adjusting the viewport for full results.
Explore Splash history to inspect request headers and cookies, and inject custom headers and user agents using set user agent, set custom headers, and on request callbacks for web scraping.
Learn how to configure splash for web scraping with private mode, cookies, custom timeouts, and user agents; inject headers, disable images, and render pages for reliable data extraction.
Learn to use Splash with Requests by posting a Lua script to a Splash container, then fetch the rendered markup for scraping.
Parse the page to extract each product's name, original price, and discounted price using xpath targeting the goods item container. Clean whitespace and export results as json or csv.
Learn how Twitter authentication works for web scraping with requests, covering login redirects, session requests, referrer headers, and dynamic authenticity tokens.
Learn to simulate login to Twitter with Python requests by creating a session, handling headers and user agent, extracting authenticity tokens, and posting login data to sessions.
Learn to parse and clean HTML to extract a tweet’s text from a profile page using XPath, headers, and requests, then remove markup with a cleaning library.
What is web scraping ?
Let's say your boss at work gave you a task where he wants you to extract about 1000 product from a website, structure the data and save it to a database, would you copy paste manually all the product details from the product name, url and price ? I can imagine you would work days and nights and you wont finish the task, so this is where web scraping shines. So web scraping, or web harvesting or web data extraction is like writing a script that will automate data extraction from websites in a matter of minutes !.
Why learn Web Scraping ?
Whether you're a data analyst, a web developer or even someone who wants to work as a freelancer you should learn web scraping.
For a data analyst building a dataset is extremely important, so without web scraping you simply can't generate it in addition to that adding web scraping in your resume is a plus for you.
Web scraping can be used in a variety of fields, so let me give you some examples on what you can do with it:
Generate leads,
Drop shipping where basically you gonna constantly scrape products from different online stores and show case them on your website to make money,
Monitor products prices to get the best deals,
automation,
Machine learning,
Web scraping freelancer
Of course there are tons and tons and variety of fields where web scraping can be extremely beneficial.
Is this course the right one for you ?
I've carefully planned and designed this course to be beginner friendly, from my experience I know those who do web scraping are mostly data analyst with no background knowledge on how the web works, how requests are made, how to locate and parse the data from the web and much much more, in addition to that this the most updated course regarding the material included and the tools used, so in this course
I'll introduce to you the most used web scraping tools/frameworks
We will setup the development environment from scratch
You will learn and understand LXML core fundamentals
How to use XPath & CSS selectors to select the data from a web page
How the web works (Request/Response)
How to scrape simple HTML web pages
How to scrape multiple web pages
Extract data from APIs
You will learn Splash(crash course) so you can use it to scrape JavaScript websites
Authentication/Login
Store the extracted data whether to JSON/CSV files or MongoDb/SQLite3
Exclusive tips and tricks regarding web scraping
Finally this course is project based, each section starting from the 2nd one we will experiment with a different website, each project has a certain degree of difficulty and each one is completely independent from other projects.
Is there is any assignments/exercises included in this course ?
Yes, each section has an assignment included to it, this will help to get your hands dirty and by the end of each section after doing the assignment included you will feel more confident and comfortable with web scraping.
Why LXML and not BeautifulSoup ?
LXML is a lightweight HTML parser even the most popular web scraping framework (Scrapy) is built on the top of LXML, BeautifulSoup is a little bit overloaded with the number of functions exposed to us, it has more functions to use, yes that's right ! however in Web Scraping most of the time we use XPath and CSS Selectors to navigate and select what to scrape from the HTML web page (tree) so there is no need to learn about new functions and wasting all that time to familiarize yourself with the BeautifulSoup API and the internal architecture, in addition to all of that LXML in terms of performance is way better than BeautifulSoup.
Who is your instructor ?
Hi! I'm Ahmed nice to meet you, my students prefer to call me web scraping Ninja and currently I have taught more than 2000 students around the world how to do web scraping. I personally do web scraping on daily basis whether for fun, for personal projects or as a freelancer and guess what ? I even have a master degree in computer science.
Should I enroll to this course ?
Honestly, by enrolling to this course you have nothing to lose, because if this course didn't meet your requirements, you can always ask for a refund in less than 30 days from the day you enrolled to the course guaranteed by Udemy with NO QUESTION TO ASK !
SO IF YOU DON'T KNOW ANYTHING ABOUT WEB SCRAPING & YOU DON'T KNOW WHERE TO START ENROLL NOW ! :)