Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Search web source code for specific string

Hey all,

I am trying to figure out how to search the source code of any website
for a specified string and return the next 14 characters back into a
cell.

In this particular instance I need to:

Search for "PARCEL="
Return "22042040150000" into cell A1

But I would like to know how to find any string in th source code.

Any help would be greatly appreciated.

Thanks,
Kyle
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Search web source code for specific string

Sounds a lot like hacking to me.

" wrote:

Hey all,

I am trying to figure out how to search the source code of any website
for a specified string and return the next 14 characters back into a
cell.

In this particular instance I need to:

Search for "PARCEL="
Return "22042040150000" into cell A1

But I would like to know how to find any string in th source code.

Any help would be greatly appreciated.

Thanks,
Kyle

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Search web source code for specific string

It's actually not. Right now I do a lot of copying and pasting to get
the info I need. I am just working on a routine that automates this
for me.
Right now not knowing how to do this is hacking. That is hacking into
my time.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Search web source code for specific string

Then you probably didn't really mean to use "source code" as the description
of what you are after. Source code is the underlying code for the operation
of a web site.

" wrote:

It's actually not. Right now I do a lot of copying and pasting to get
the info I need. I am just working on a routine that automates this
for me.
Right now not knowing how to do this is hacking. That is hacking into
my time.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Search web source code for specific string

I mean when I am in internet explorer and select view source from
the menu bar, which brings up the HTML code.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Search web source code for specific string

Is there anyone that has any ideas. Anything to even point me in the
right direction.
  #7   Report Post  
Posted to microsoft.public.excel.programming
ron ron is offline
external usenet poster
 
Posts: 118
Default Search web source code for specific string

On Oct 28, 7:33*pm, wrote:
Hey all,

I am trying to figure out how to search the source code of any website
for a specified string and return the next 14 characters back into a
cell.

In this particular instance I need to:

Search for "PARCEL="
Return "22042040150000" into cell A1

But I would like to know how to find any string in th source code.

Any help would be greatly appreciated.

Thanks,
Kyle


Kyle...This should do what you want, just insert your url..ron

Sub Search_SourceCode()
' Get the source code from the web page
my_url = "http://yoururl.com"
Set my_obj = CreateObject("MSXML2.XMLHTTP")
my_obj.Open "GET", my_url, False
my_obj.send
my_var = my_obj.responsetext
Set my_obj = Nothing

' Find search term and assign next 14 characters to a variable
my_term = "Parcel="
pos_1 = InStr(my_var, my_term)
next14 = Mid(my_var, 7 + pos_1, 14)

'Paste to worksheet
Range("A1").Select
activecell = next14
End sub

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Search web source code for specific string

Hey Ron,

Thanks for your response, this definitly pointed me in the right
direction. I appreciate your help.

Thanks,
Kyle
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search for number after specific text in string AMH Excel Worksheet Functions 8 September 4th 09 03:05 PM
Find specific info using search string using VBA laavista Excel Discussion (Misc queries) 5 May 20th 09 07:59 PM
Excel XP VBA code to search all macro code in Excel module for specific search string criteria Ed[_18_] Excel Programming 4 May 20th 04 02:08 PM
Excel XP VBA code to search all macro code in Excel module for specific search string criteria Frank Kabel Excel Programming 0 May 19th 04 08:11 PM
Excel VBA to search all macro code in Excel module for specific string criteria Roger1947 Excel Programming 0 May 19th 04 05:51 PM


All times are GMT +1. The time now is 08:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"