Forum Discussion

jason_drummond's avatar
jason_drummond
New Member
2 years ago

Cookie Blocker when querying a webpage

Hi all,

 

Looking for some help when trying to query a webpage. The following page Leagues | LTA - Tennis for Britain has cookie pop up that blocks access to the page. Trying to pull data from PowerBI desktop for my local team to enable scheduling of matches but can't seem to get past this. 

 

Have seen this post below but still can't get past the message:

https://community.fabric.microsoft.com/t5/Power-Query/Bypass-cookies-consent-on-web-scraping/m-p/1462021#M45568

 

Any help would be greatly appreciated.

 

Cheers

 

Jason

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,jason_drummond ,
    I am glad to help you.

    According to your description, the cookie request popped up when you visited the target page

    Here are my test results

    The first time I visited the site, a cookie request appeared

    like this:

    I clicked “accept” and it worked fine.

    The second time I visit it, I don't get a similar access request page.

    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

    Best Regards,

    Carson Jian,

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • jason_drummond's avatar
      jason_drummond
      New Member
      Hi, thanks for your reply. Unfortunately this doesn't work if I am trying to connect to the webpage from PowerBI Desktop. The cookie pop-up stops PowerBI from getting to any data and I need help in working out some way to bypass the cookie in the Power Query Advanced Editor. Thanks Jason
      • Anonymous's avatar
        Anonymous
        Not applicable

        Hello,jason_drummond 
        Thank you for replay .
        I am sorry that I didn't understand what you meant and gave wrong advice before.
        For the idea that you want to jump the cookie block when fetching website data in power BI and you want to bypass the cookie limitation. I  suggest that you try using the API.

        Please check if the website offers an API:
        In general, most websites provide APIs for programmatically accessing their data. Using an API (if available) is a more reliable and ethical way of accessing the data you need, without having to deal with web crawling issues such as cookie consent. You can usually find information about available APIs in the footer or developer section of a website.
        Here is the official documentation for APIs in the power BI .
        url:Develop with the REST APIs for Power BI Report Server - Power BI | Microsoft Learn

        I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

        Best Regards,

        Carson Jian,

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.