Forum Discussion
Expression.Error: Access to the resource is forbidden.
I'm trying to connect to the following url (I had previously built a fully functional web scrape), but now the following sources return Expression Errors, saying "Access to the resource is forbidden".
I've tried clearing my permissions and re-establishing the connection, but it always produces the same error. I know this worked before, so I'm wondering whether Oddschecker is actively now blocking the connection in some way. Does this work at all for anyone else? I'd really appreciate some help.
Thanks!
7 Replies
- artemus
Microsoft Employee
It is probably blocking browsers, it doesn't reconise.
You could try to use this instead:
Web.Page("https://www.oddschecker.com/sport/football/sitemap.xml")
- jmillsjmills
Helper III
Ah yes thank you so much. That's clearly the issue - it doesn't want to provide results to Internet Explorer. Is there any way you can not have Power BI in effect use Internet Explorer to serve its web queries please? Can you prompt it to go via Edge, for example? Seems odd Microsoft are deprecating IE but have it as the focal point for Power BI queries
- v-jingzhang
Community Support
Hi jmillsjmills
You can use Web.BrowserContents() and Xml.Tables() to get the data. Here are my M codes.
let Source = Xml.Tables(Web.BrowserContents("https://www.oddschecker.com/sport/football/sitemap.xml")), Table = Source{1}[Table], Table1 = Table{0}[Table], #"Changed Type" = Table.TransformColumnTypes(Table1,{{"Attribute:id", type text}, {"span", type text}, {"Attribute:class", type text}}), #"http://www sitemaps org/schemas/sitemap/0 9" = #"Changed Type"{0}[#"http://www.sitemaps.org/schemas/sitemap/0.9"], urlset = #"http://www sitemaps org/schemas/sitemap/0 9"{0}[urlset], url = urlset{0}[url], #"Changed Type1" = Table.TransformColumnTypes(url,{{"loc", type text}, {"changefreq", type text}}) in #"Changed Type1"Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.- jmillsjmills
Helper III
Thanks so much - that works. But I still have the issue that Oddschecker is no longer supported on Internet Explorer and therefore when I go to pull data in from the specific page URLs like the following...
https://www.oddschecker.com/football/english/premier-league/brighton-v-southampton/winner ... the only content it pulls back to the report amounts to the page saying "Unsupported on Internet Explorer"
How can I get the Web.BrowserContents function to operate via Microsoft Edge instead? To me it seems very odd that Power BI is still dependent on Internet Explorer by default, when Microsoft are deprecating it in a few months time!
Thanks
- v-jingzhang
Community Support
Hi jmillsjmills
You can try checking the option Use my default web browser from Options and settings > Security.
Jing