Forum Discussion
Another Web Scraping Query
Thanks so much for coming back Aniya!
Sorry, I'm not quite following. Are you able to test on your side whether you can pull this data in? The link you've provided exactly the sort of thing I've been playing with but I simply cannot work out how to pull the data.
If you are able to kindly provide what the Power Query code would need to be exactly in this instance, I would be so very grateful!
Thank you so SO much!
Hi , jmillsjmills
This url is your internal , i cannot test in my workaround, but you can try to use this and replace the url for yours to test .
let
url = "https://www.betfred.com/services/SportsBook/event?language=uk&type=event&eventid=22385490.2&dataflag...[your url should replace here]",
headers = [#"Accept"="application/json"],
response = Web.Contents(
url,
[
Headers = headers
]
),
jsonResponse = Json.Document(response)
in
jsonResponse
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- jmillsjmills3 years agoHelper III
Thanks so much for this Aniya but I'm afraid I'm getting a similar message to before:
It can't seem to read this source code and is insisting that it is HTML.. Do you have any other ideas at all please? Was the above working for you? I inputted https://www.betfred.com/services/SportsBook/event?language=uk&type=event&eventid=22385490.2&dataflags=14&datasize=8&cachebust=1668982826349 in place of your URL
Thanks
- v-yueyunzh-msft3 years agoCommunity Support
Hi , jmillsjmills
For the url , I need to determine if you're using the correct URL.
For URLs, you need to use your URL in "F12" instead of your URL at the top of the browser.
As prompted, your URL returns an HTML format.
You need to make sure that the URL used is the Request URL you showed in the screenshot.
Second, you can also check "F12" to see if there are other "headers" that need to be added.
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- jmillsjmills3 years agoHelper III
That's exactly what I am doing yes. When I'm copying and pasting the URL onto here, it seems to be shortening it. But if you click through to the link, that's the full URL I am using. But for whatever reason I'm still getting this same error as shown in yellow on the previous screenshot. I know I am being silly but please spell out how I can get Power Query to process this information as JSON rather than HTML. Do you have this exact URL working on your side please? It clearly provides functional JSON given this is how it previews in the "Inspect" feature on a web browser. But Power Query is determined to treat it as HTML... Thank you so so much for your patience with my slow understanding!