Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Pulling in a web source that prompts for zip code

Hello!

 

I am trying to reference a table on a website that is only accessible after entering in a zip code (so the site can display the correct information based on zip). Does anyone know how to pass a set value in order to get to the table?  

 

Thanks in advance!

3 Replies

  • Anonymous once you enter the zip code it probably adds that a query parameter in the URL, can you get that URL from the browser and then use that as a starting point, concatenate the zip code from Power BI in the URL, and pull the data.

     

    Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

  • Hi Anonymous 

    So if you are accessing this site in a regualr web browser you'd go to the site then type in the ZIP code, which causes the site to load the data you want?

    In doing this if the site URL does not change but the contents of the page are, then the site may be using JavaScript/AJAX to load page contents.  It could be just a POST request back to a PHP script but can't tell without seeing the site.

    Either way, if the site requires you to input something to the page directly, you can't do this in Power Query/PBI.  You'd need to use something like VBA to drive a browser session and input the ZIP code then scrape the data.

    https://www.myonlinetraininghub.com/web-scraping-filling-forms

    Regards

    Phil