scraping a date from website (power query doesn't see it)

sokol84

New Member
Joined
Apr 4, 2022
Messages
1
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
  2. Web
Hi,
I'm trying to scrap the date from this website: Terminal Gate Price » Puma Energy
When you open the website, it is always showing you the latest prices. The validity date of prices is also directly mentioned on the website (in the source it is in this line:
<p><strong>Pricing effective from 5 April 2022.</strong></p>).

When I connected to the website through power query, the date doesn't appear in any of the tables.

1. I need to pick that date and save it in a cell in excel worksheet.
2. Additionally, I would like to be able to go to the website and pick a date from the past (through datepicker) and then pull the data by power query.

Anyone can help with that? I have some VBA experience, but it is limited to tasks within excel, no experience with web scraping other than through power query.

Cheers
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
try the bit of code:
VBA Code:
Sub Gethtmldata()

Set FinHTTP = CreateObject("Microsoft.xmlHTTP")
Dim FinRows
initstring = "https://www.pumaenergy.com.au/for-business/terminal-gate-price/"
urlstring = initstring
FinHTTP.Open "GET", urlstring, False
  FinHTTP.send
  textmess = FinHTTP.responseText
'  MsgBox textmess
  FinRows = Split(FinHTTP.responseText, Chr(10))
  For j = 0 To UBound(FinRows) - 1
     txxt = FinRows(j)
     tt = InStr(1, FinRows(j), "Pricing effective from", vbTextCompare)
     If tt > 0 Then
     dateline = FinRows(j)
     MsgBox (Mid(dateline, 20, 35))
     Exit For
     End If
  Next j
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,947
Members
448,534
Latest member
benefuexx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top