Skip to content
Advertisement

Scrape a page to get encoded javascript link

I am working on a task in which I have to get details from a web page using python request library. I have successfully got the details from the page but it has a button “Show Details” which fetches more details using ajax call, now I need to fetch those extra details also. can anyone help me in doing so? here’s the link to website:- http://ipindiaonline.gov.in/tmrpublicsearch/frmmain.aspx and a screen shot of website here:
enter image description here

Here’s my code which i have made.

JavaScript

Advertisement

Answer

You need to create another POST request using information from the first POST request. The following shows how the Goods & Services Description could be extracted from the returned data:

JavaScript

This would display:

JavaScript

Note: The data returned contains other fields which are separated by the | character. The HTML for the details also happens to contain this character so it is necessary to extract fields 7 and 8 to get just the HTML.

Advertisement