Forum Discussion
How to extract hyperlink from webpage - Yellowpages example
- 7 years ago
No worries guys! I figured it out by myself!
here is the code for future reference:
let
Source = Web.BrowserContents("https://www.yellowpages.com.au/search/listings?clue=Child+Care+Centres&locationClue=Victoria&pageNumber=2&referredBy=www.yellowpages.com.au&eventType=pagination"),
#"Extracted Table From Html" = Html.Table(Source, {{"Name", ".inside-gap-medium.vertical:nth-child(1) > .first-cell > DIV.media-object.clearfix.inside-gap-medium.image-on-right.listing-summary:nth-child(1):nth-last-child(1) > .body > .listing-name"}, {"Website","a[href^=""http""]", each [Attributes][href]}} , [RowSelector=".search-results > DIV.flow-layout.outside-gap-large.inside-gap.inside-gap-large.vertical:nth-child(1):nth-last-child(1) > .in-area-cell"]),
#"Changed Type" = Table.TransformColumnTypes(#"Extracted Table From Html",{{"Name", type text}, {"Website", type text}})
in
#"Changed Type"
No worries guys! I figured it out by myself!
here is the code for future reference:
let
Source = Web.BrowserContents("https://www.yellowpages.com.au/search/listings?clue=Child+Care+Centres&locationClue=Victoria&pageNumber=2&referredBy=www.yellowpages.com.au&eventType=pagination"),
#"Extracted Table From Html" = Html.Table(Source, {{"Name", ".inside-gap-medium.vertical:nth-child(1) > .first-cell > DIV.media-object.clearfix.inside-gap-medium.image-on-right.listing-summary:nth-child(1):nth-last-child(1) > .body > .listing-name"}, {"Website","a[href^=""http""]", each [Attributes][href]}} , [RowSelector=".search-results > DIV.flow-layout.outside-gap-large.inside-gap.inside-gap-large.vertical:nth-child(1):nth-last-child(1) > .in-area-cell"]),
#"Changed Type" = Table.TransformColumnTypes(#"Extracted Table From Html",{{"Name", type text}, {"Website", type text}})
in
#"Changed Type"