Answer the question
In order to leave comments, you need to log in
Grabbing - why does the mouse not click on the element?
Good afternoon.
I'm trying to rob fl.ru for myself under a certain filter "Layout".
To quickly notice new projects.
To do this, I use nodeJS and the puppeteer library to set the desired project filter by simulating a mouse click. However, the last mouse click for some reason does not work.
I can't understand why?
Here is the code:
const fs = require('fs');
const puppeteer = require('puppeteer');
const url = 'https://www.fl.ru/projects/';
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(url);
await page.click('.b-combo__arrow');
try{
await page.addStyleTag({path : './my-css.css'})
await page.click('.b-combo__body_left > .b-combo__list > .b-combo__item:first-child');
await page.click('.b-layout__right_bordleft_cdd1d3 .b-combo__list > .b-combo__item:first-child');
await page.click('.b-layout__right_bordleft_cdd1d3 .b-combo__list > .b-combo__item:first-child > span');
}
catch (err){
console.log('\n\n-----------Error description beginning-----------\n');
console.log(err);
console.log('\n-----------Error description end-----------\n\n')
await browser.close();
}
await page.pdf({path: './page.pdf'});
await browser.close();
})();
Answer the question
In order to leave comments, you need to log in
1) Do you need to click exactly on > span at the end?!
2) Try xPath directly to use
3) Logs of actions (where the error crashes) also lay out something like that, one could immediately tell from them
I parsed already somehow fl.
There the usual static page is generated. As already mentioned in the comments, there is no need for a browser.
How I did it.
I typed the filter I needed, the filter itself is displayed in the get (I don’t remember right now) parameter. And then I pulled a specific url and parsed the orders I needed from there ....
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question