Disable javascript

27 views
Skip to first unread message

Luca Peppe

unread,
Jul 13, 2017, 6:46:12 AM7/13/17
to Selenium Users
Hello,
I'm trying to get some data from this website (for an university project)


I need the data inside the table before the page completes to load. I noticed that disabling javascript, when the loading ends there is still all the data I need inside the table.
My problem is that with javascript when the driver.get method is completed my data is already gone. I also tried using a timeout to block the page loading but it doesn't work all the times.

At this point I think the best way to solve the problem is to disable javascript but I can't manage to make it work inside the driver, can you help me?

David

unread,
Jul 13, 2017, 5:33:37 PM7/13/17
to Selenium Users
Maybe better to check if the data you want is actually fetched via an AJAX call to some server and then you call that server via HTTP/REST instead of using Selenium. That would be much more easier and optimal. You just need to spy on the network requests on that site via browser dev tools / Wireshark to see if the data is coming from one of the network requests and directly make that request instead.

Xiang Dong

unread,
Jul 14, 2017, 3:53:13 AM7/14/17
to seleniu...@googlegroups.com

for retrieve table data purpose, it is not necessary to disable the Javascript. Disable Javascript may cause a lot of Webdriver functions abnormal. You can have a iteration to click ">" button and retrieve every 10 records back. ">" button class will change to disabled when the final page arrived. It is not hard, at least easier than disable javascript. 


Best Regards,

--david




From: seleniu...@googlegroups.com <seleniu...@googlegroups.com> on behalf of David <mang...@gmail.com>
Sent: Friday, July 14, 2017 5:33 AM
To: Selenium Users
Subject: [selenium-users] Re: Disable javascript
 
Maybe better to check if the data you want is actually fetched via an AJAX call to some server and then you call that server via HTTP/REST instead of using Selenium. That would be much more easier and optimal. You just need to spy on the network requests on that site via browser dev tools / Wireshark to see if the data is coming from one of the network requests and directly make that request instead.

On Thursday, July 13, 2017 at 3:46:12 AM UTC-7, Luca Peppe wrote:
Hello,
I'm trying to get some data from this website (for an university project)

https://www.quattrocalici.it/ricerca/denominazioni
Tramite questo modulo è possibile ricercare il database delle Denominazioni di Origine Italiane, vinicole o agroalimentari, DOCG, DOC, IGT, DOP, IGP



I need the data inside the table before the page completes to load. I noticed that disabling javascript, when the loading ends there is still all the data I need inside the table.
My problem is that with javascript when the driver.get method is completed my data is already gone. I also tried using a timeout to block the page loading but it doesn't work all the times.

At this point I think the best way to solve the problem is to disable javascript but I can't manage to make it work inside the driver, can you help me?

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/fd9c6f16-a264-4b35-b89b-667f03c3b7e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages