java - How to check with Selenium WebDriver if a site is using Ajax? -


i doing research , development on few unknown third party websites page content using selenium.

how should know whether website ajax based or non-ajax based. don't know data inside of unknown website check though using id or tag name, how should check ajax based or not.

if you, set proxy , route webdriver traffic thru that. in proxy, each request parse request headers , header

x-requested-with = xmlhttprequest 

reference

if have that, can (with fair amount of confidence) say, had ajax invoked. there may corner cases you'll miss, should of them.

anyway, need consider ajax calls may not done on page load, may require user interaction trigger calls.

you can try tackle using webdrivers getpagesource() method , apply method output looking patterns $.get( , $.post( , $.ajax( , other ones can come with.

you may interested in this answer setting proxy.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -