Navigate to a Web Page
Learn how to create a browser instance in Puppeteer and navigate to a web page.
The first step in the web scraping procedure is navigating to the web page we plan to scrape. When we do this manually, what we do is:
Launch the browser.
Open a new browser page.
Navigate to the web page.
When we use Puppeteer, we must follow the same steps. Let’s see how we can instruct Puppeteer to perform the above tasks:
Launch the web browser
We can open the browser using the launch
function in Puppeteer, as shown in the code snippet below. With default configurations, this will launch a Chromium browser bundled with Puppeteer.
We can use the returned reference variable from the launch
function to interact with it further.
Get hands-on with 1300+ tech skills courses.