1

I'm working on a project for school and Im having trouble parsing a webpage. I call it "dynamic" because the content changes every time we change a search parameter.

This is the link https://en.mygon.com/#!guia/todas-as-categorias/portugal/amanha/qualquer-hora

When you click it, it will show some search results. However I can't find them in the page source code, but I do identify that the search is related to a script (i think).

     <input id="search-words-button" type="button" class="action submit" onClick="searchWordsElement();" value="GO"/>

How can i use jsoup to parse the results from this page?

Thank you

virgula24
  • 523
  • 5
  • 23

1 Answers1

1

You cant find it on the source page because the link is running a javascript that is populating the page dynamically based on a return JSON from this link

https://en.mygon.com/MGMDW/REST/web/client/shops/getShops?startIndex=0&pageSize=30&hourInterval=0&onlyPromotions=false&categoryId=0&day=5&searchWords=sushi&languageCode=en_EN&originMygon=true&capital=portugal%2C+portugal&_=1410373067855

JSoup wont help you in this case.

Run the link that I posted and change searchWords=sushi for the search that you want and the result will be a JSON that is easily parsed

[]s

Gust
  • 46
  • 5