2

Suppose there is a website which calls ajax requests everytime however I can't find(or see) any related URL in page source. But I can see every request or ajax calls in network tab using developer tools.

Please refer screenshot I attached to find URL in network tab. Let's say Google analytics link. How can I search the same URL using javascript or any programming language instead of opening network tab or any developer tool?

I want to see that request URL using programming language. I would prefer javascript if there is. Is it possible or any API available to find the usage of requested links?

I would appreciate if it is possible to get it done using Python, Javascript, Java or PHP.

HELP WOULD BE APPRECIATED!

Baba ramdev
  • 61
  • 1
  • 3

1 Answers1

0

You can use a browser automation tool like Selenium.

Try this python code.

from selenium import webdriver

driver = webdriver.Chrome()
driver.get("yourwebsiteurl here")
driver.implicitly_wait(10)
ajax_urls = driver.execute_script("return performance.getEntries().map(entry => entry.name)")

for url in ajax_urls:
    print(url)
Sazzad Hussain
  • 321
  • 1
  • 3
  • 11