Am trying to scrape the title and price from mcmaster.com to auto populate an internal purchase rec form. (URL with item part number is hard coded below for testing.) Got the title fine, but can't get the price. I don't think my code is looking at the correct place because the element is not found. I modeled my code from here.
Sub get_title_header()
Dim wb As Object
Dim doc As Object
Dim sURL As String
Set wb = CreateObject("internetExplorer.Application")
sURL = "https://www.mcmaster.com/#95907A480"
wb.navigate sURL
wb.Visible = True
While wb.Busy Or wb.readyState <> READYSTATE_COMPLETE
DoEvents
Wend
'Wait a bit for everything to catchup...(network?)
Application.Wait (Now + TimeValue("0:00:02"))
'HTML document
Set doc = wb.document
Dim MyString As String
MyString = doc.Title
Sheet2.Cells(1, 2) = Trim(Replace(MyString, "McMaster-Carr -", "", , , vbTextCompare))
Dim el As Object
For Each el In doc.getElementsByName("Prce")
Sheet2.Cells(2, 2).Value = el.innerText
Next el
wb.Quit
End Sub
Is this iframe nested? Can anyone explain why my code can't see the iframe data and help me get the item price? Thanks in advance!