Forum Discussion
Access to Resource Forbidden - Web Contents
Web.Contents only gets you that far. You need to use Web.BrowserContents and then parse the HTML.
You can omit all the query parameters that are blank.
let
Source = Web.BrowserContents("https://www.tenders.act.gov.au/tender/search?tenderState=OPEN&categories%5B0%5D.fullTitle=43000000+Information+Technology+Broadcasting+and+Telecommunications&categories%5B0%5D.id=104789&categories%5B0%5D.percentage=100&openThisWeek=false&closeThisWeek=false&awardedThisWeek=false&groupBy=NONE"),
#"Extracted Table From Html" = Html.Table(Source, {{"Column1", ".tender-code-state"}, {"Column2", ".tender-code-state .tablesaw-cell-content"}, {"Column3", ".tablesaw-cell-content B"}, {"Column4", ".tender-code-state + *"}, {"Column5", ".strong"}, {"Column6", ".tender-date"}, {"Column7", ".opening_date"}, {"Column8", ".closing_date"}, {"Column9", "DIV:nth-child(2) .line-item-detail"}, {"Column10", "DIV:nth-child(3) .line-item-detail:nth-child(1)"}, {"Column11", ".tender-code-state .tablesaw-cell-label"}, {"Column12", ".tender-row-state"}, {"Column13", ".tender-date .tablesaw-cell-label"}, {"Column14", ".date_label_list:nth-child(1)"}, {"Column15", ".date_label_list:nth-child(5)"}, {"Column16", ".line-item-detail:nth-child(2)"}, {"Column17", ".line-item-detail:nth-child(3)"}}, [RowSelector="TBODY TR"])
in
#"Extracted Table From Html"Hey lbendlin thank you so much for your response.
The issue that I continuall come across with Web.BrowserContents() is that I can't get it to refresh in Power Bi Service without installing a on-premises personal gateway?
I could be wrong but why do I need an on-premises gateway to hit a public website? as such Web.Contents is the only option I can seem to use to achieve the outcome I want.
If you have a workaround or any ideas it would be a huge help.
Thanks,
M
- lbendlin1 year agoSuper User
What you are doing is basically screen scraping. This is frowned upon. The "correct" way would be to use the data API that your data source should provide. That's what Web.Contents is designed for - for APIs, not for webpage scraping.