docs: update example to align with the website (#7788)

Update example to align with the website. `news.ycombinator.com` uses class `.titlelink`.
This commit is contained in:
Maksim Sadym 2022-02-16 08:51:20 +01:00 committed by GitHub
parent 5cf6f5f6cb
commit f7c59223ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,7 +34,7 @@ const firefoxOptions = {
await page.goto('https://news.ycombinator.com/');
// Extract articles from the page.
const resultsSelector = '.storylink';
const resultsSelector = '.titlelink';
const links = await page.evaluate((resultsSelector) => {
const anchors = Array.from(document.querySelectorAll(resultsSelector));
return anchors.map((anchor) => {