Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse html for particular tag content

Status
Not open for further replies.

bernie321

Programmer
Jan 7, 2004
477
GB
Hi

We have an intranet site that we are converting parts of it to a database, there is a specific bit of info that we need from the html within the below tag:

style="bg-image:url('xxxxxxxxxxxxx')"

I have the HTML data in a string variable but need to get the xxxxxxx section out of the tag.

If I can automate this it will save me hours. Any help would be much appreciated.

Thanks
B
 
Well, if the tag is always the same you should be able to do something like this:

'assuming the string with the tag is named strTag

Dim StartPoint As Integer
Dim EndPoint As Integer
Dim ImageURL As String

StartPoint = strTag.IndexOf("'") + 1
EndPoint = strTag.LastIndexOf("'") - 1

ImageURL = strTag.Substring(StartPoint, EndPoint)



I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top