Forum Discussion

jmillsjmills's avatar
jmillsjmills
Icon for Helper III rankHelper III
6 years ago

Web Scrape: The request was aborted: The connection was closed unexpectedly.

Hello,

 

I'm trying to use Power BI Desktop to connect to the below domain and whenever I attempt doing so it fails and says "Unable to connect. We encountered an error when trying to connect. Details: "The request was aborted: The connection was closed unexpectedly."

 

I posted the URL in a message on here before, but it flagged as spam. The website is BoyleSports (.com!) and if anyone would be able to help me understand why this particular site returns a failure to connect, it would be most appreciated! Perhaps I need to add some parameters/headers for the connection to be successful?

 

I've just been using the Get Data > From Web method to pull in information, but is there a more advanced function required into this instance?

 

Thanks so very much in advance. It is much appreciated!

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi jmillsjmills ,

    First, please make sure that you can access to the web page by browser. If you can access successfully, it may be caused by the version of TLS or .Net is too low, you can refer the solution in the following thread to resolve it. Any comment or problem, please feel free to let me know.

    Underlying connection was closed: An unexpected error occurred

    Best Regards
    Community Support Team _ Rena Ruan
    If this post helps, then please consider Accept it as the solution to help the other members find it more.

    • jmillsjmills's avatar
      jmillsjmills
      Icon for Helper III rankHelper III

      Thanks for your response! It's a simple point I'd missed - that website is not supporting being accessed via Internet Explorer anymore, which I understand is the default browser for Power BI to connect to a site in order to web scrape..

       

      So I've fallen at the first hurdle and I assume it doesn't have to do with the TLS! The question is.. is there some possibility to pull in the source code (to then run ExtractFromHTML function), via a different non-Internet-Explorer browser?

       

      Thanks so much again for your help! Much appreciated

      • PhilipTreacy's avatar
        PhilipTreacy
        Icon for Super User rankSuper User

        Hi jmillsjmills 

        Try this

         

            Source =  Web.Page(Web.BrowserContents("https://www.boylesports.com")),

         

         Works for me to download the HTML and can then see the various elements in the page.


        If I answered your question please mark my post as the solution.
        If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.