Forum Discussion
Retrieving data via HTML
Hello
I am retrieving company information as a table using the following query. Since the data is retrieved from the table, a timeout issue occurs on the website. Is it possible to retrieve the data using HTML? I request your assistance.
let
Kaynak = Web.BrowserContents("https://www.isyatirim.com.tr/tr-tr/analiz/hisse/Sayfalar/Temel-Degerler-Ve-Oranlar.aspx#page-1"),
#"Html'den Ayıklanan Tablo" = Html.Table(Kaynak, {{"Column1", "TABLE[id='summaryBasicData'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(8), TABLE[id='summaryBasicData'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8)"}, {"Column2", "TABLE[id='summaryBasicData'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(7), TABLE[id='summaryBasicData'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7)"}, {"Column3", "TABLE[id='summaryBasicData'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(7) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(6), TABLE[id='summaryBasicData'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(6)"}, {"Column4", "TABLE[id='summaryBasicData'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(7) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(6) + TH[colspan=""1""][rowspan=""1""]:nth-child(4):nth-last-child(5), TABLE[id='summaryBasicData'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(5)"}, {"Column5", "TABLE[id='summaryBasicData'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(7) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(6) + TH[colspan=""1""][rowspan=""1""]:nth-child(4):nth-last-child(5) + TH[colspan=""1""][rowspan=""1""]:nth-child(5):nth-last-child(4), TABLE[id='summaryBasicData'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(4)"}, {"Column6", "TABLE[id='summaryBasicData'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(7) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(6) + TH[colspan=""1""][rowspan=""1""]:nth-child(4):nth-last-child(5) + TH[colspan=""1""][rowspan=""1""]:nth-child(5):nth-last-child(4) + TH[colspan=""1""][rowspan=""1""]:nth-child(6):nth-last-child(3), TABLE[id='summaryBasicData'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(3)"}, {"Column7", "TABLE[id='summaryBasicData'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(7) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(6) + TH[colspan=""1""][rowspan=""1""]:nth-child(4):nth-last-child(5) + TH[colspan=""1""][rowspan=""1""]:nth-child(5):nth-last-child(4) + TH[colspan=""1""][rowspan=""1""]:nth-child(6):nth-last-child(3) + TH[colspan=""1""][rowspan=""1""]:nth-child(7):nth-last-child(2), TABLE[id='summaryBasicData'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(3) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(2)"}, {"Column8", "TABLE[id='summaryBasicData'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(7) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(6) + TH[colspan=""1""][rowspan=""1""]:nth-child(4):nth-last-child(5) + TH[colspan=""1""][rowspan=""1""]:nth-child(5):nth-last-child(4) + TH[colspan=""1""][rowspan=""1""]:nth-child(6):nth-last-child(3) + TH[colspan=""1""][rowspan=""1""]:nth-child(7):nth-last-child(2) + TH[colspan=""1""][rowspan=""1""]:nth-child(8):nth-last-child(1), TABLE[id='summaryBasicData'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(3) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(2) + TD:not([colspan]):not([rowspan]):nth-child(8):nth-last-child(1)"}}, [RowSelector="TABLE[id='summaryBasicData'] > * > TR"]),
#"Tanıtılan Üst Bilgiler" = Table.PromoteHeaders(#"Html'den Ayıklanan Tablo", [PromoteAllScalars=true]),
#"Değiştirilen Tür" = Table.TransformColumnTypes(#"Tanıtılan Üst Bilgiler",{{"Kod", type text}, {"Hisse Adı", type text}, {"Sektör", type text}, {"Kapanış(TL)", type number}, {"Piyasa Değeri(mn TL)", type number}, {"Piyasa Değeri(mn $)", type number}, {"Halka AçıklıkOranı (%)", type number}, {"Sermaye(mn TL)", type number}})
in
#"Değiştirilen Tür"
11 Replies
- v-saisrao-msftCommunity Support
Hi Mekist ,
The timeout probably happens because the table loads dynamically, so Web.BrowserContents may capture the HTML before everything is fully rendered. To make it more stable, try using the WaitFor option to delay extraction until the table is visible, and increase the command timeout for more loading time. If you can access the data as static HTML or through an API, using Web.Contents would be faster and more reliable.
Troubleshooting the Power Query Web connector - Power Query | Microsoft Learn
Power Query Web connector - Power Query | Microsoft Learn
Web.BrowserContents - PowerQuery M | Microsoft Learn
Thank you.
- v-saisrao-msftCommunity Support
Hi Mekist,
Have you had a chance to review the solution we shared earlier? If the issue persists, feel free to reply so we can help further.
Thank you.
- MekistHelper III
Hello
I had the opportunity to check it, but the web page timed out again, so I followed a different process. Thank you for your support.
- v-saisrao-msftCommunity Support
Hi Mekist,
Since you mentioned using a different approach, could you share your insights on the issue? This would be helpful for community members who are experiencing similar problems.
Thank you.