docs: fix cross-browser.js example (#9291)
The previous selector is broken as of ~2 months ago, c.f. https://news.ycombinator.com/item?id=33027700 Changed from: <a class="titlelink"></a> To: <span class="titleline"> <a></a> </span>
This commit is contained in:
parent
078d385671
commit
b6ffa732ac
@ -34,7 +34,7 @@ const firefoxOptions = {
|
||||
await page.goto('https://news.ycombinator.com/');
|
||||
|
||||
// Extract articles from the page.
|
||||
const resultsSelector = '.titlelink';
|
||||
const resultsSelector = '.titleline > a';
|
||||
const links = await page.evaluate(resultsSelector => {
|
||||
const anchors = Array.from(document.querySelectorAll(resultsSelector));
|
||||
return anchors.map(anchor => {
|
||||
|
Loading…
Reference in New Issue
Block a user