Not able to extract text from webpage

Author Message
musicgold

  • Total Posts : 7
  • Scores: 0
  • Reward points : 0
  • Joined: 11/18/2009
  • Status: offline
Not able to extract text from webpage Sunday, November 07, 2010 5:05 AM (permalink)
0
Hi,

I am using the following VBA code to extract text from a webpage

I am interested in the text inside a node called SPAN. As there are some unwanted SPAN nodes, I am trying to differentiate them on the basis of their font type, but I am getting an error at hinput.font = ”verdana” (run time error 438).
What property can I use to differntiate the SPAN nodes?
 
 VBA code
…
Set hdoc = IE.document
Set hColl = hdoc.getElementsByTagName("SPAN")
For Each hinput In hColl
If hinput.font = ”verdana” then
MsgBox hinput.innertext
...
Next 

HTML source code 
<span style='font:normal 12px verdana;color:#000000;'>Dad: Ess Baar exam me paas ho<br>ya fail BIKE zarur dilaunga.<br>Son: Kaunsi bike?<br>Dad: Pass he to “APACHE” college<br>jane ke liye.<br>Fail hue to “RAJDOOT” dood<br>bechne ke liye...</span> 

 
Thanks,
MG.
 
#1

    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2012 ASPPlayground.NET Forum Version 3.9