Read Content From A Website

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi all,
i want to read the dynamic content of a website..
i.e.,
Open http://www.thebulliondesk.com/
in that website at the very top there is a table kind of thing showing
Prices for Gold Price and Silver Price.
i want to read the prices of gold and silver (dynamic prices)from that
website and use them in my application.
is it any way possible to do so, and if so can u plz guide me how to do it..

thanks for the help in advance.

i tried saving the page's content in a .txt fromat but those dynamic values
were not there in the .txt file.
 
Hi Pramod,
Open http://www.thebulliondesk.com/
in that website at the very top there is a table kind of thing showing
Prices for Gold Price and Silver Price.
i want to read the prices of gold and silver (dynamic prices)from that
website and use them in my application.
is it any way possible to do so, and if so can u plz guide me how to do it..

Data, get external data, new web query is the way to go I guess.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com
Member of:
Professional Office Developer Association
www.proofficedev.com
 
hi Jan,
i tried doing it.. it showed an error saying that :"the query does not
return any value"
i tried exporting the whole page into excel and as u can see in the web page
there are colums showinf bid-ask-(+/-)-LDN, but the cells do not show the
values or the bid and ask column, as i think they r dynamic values.
so is there any other possibility to read the data.

thanks 4 the reply JAN
 
Pramod,

The code below worked for me:

Regards,
David Miller


Function GetPrices()
Dim ie As Object, _
l, J As Long, _
r As Range

Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.navigate "http://www.thebulliondesk.com/" & _
"RHS_CHARTS.aspx?Chart=Fix"
Do Until .readystate = 4
DoEvents
Loop
With .document.all
For l = 0 To .Length
If .Item(l).classname = "td" Then
Set r = Range("A65536").End(xlUp).Offset(1, 0)
Select Case .Item(l).innertext
Case "Gold"
For J = 0 To 5
r.Offset(0, J).Value = .Item(l +
J).innertext
Next J
Case "Silver"
For J = 0 To 5
r.Offset(0, J).Value = .Item(l +
J).innertext
Next J
GoTo PricesExit
End Select
End If
Next
End With
End With
PricesExit:
Set r = Nothing
Set ie = Nothing
End Function
 
HI Dave

the piece of code u provided i tried pating it in a module in a n excel
sheet and then in workbook_open i called that function, by which it opened
internet explorer and showed the webpage pointing in the code. but i want the
data in the excel sheet..

and am i going the right way in executing the following code provided by
you. else guide me throught the steps.

thanks
Pramod Mehta
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top