Parse url in htm page

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
darioit
Posts: 230
Joined: 02 Aug 2010 05:25

Parse url in htm page

#1 Post by darioit » 14 Nov 2011 08:51

Hi everybody,

I need to parse a specific url inside htm page

I start with this example

call script Web_page string_to_parse
call go.bat http://www.wikipedia.org/ http://it.wikipedia.org/

go.bat:

Code: Select all

for /F "usebackq tokens=1-3 delims=," %%a in (`cscript /nologo GetHtml.vbs %1`) DO (
  echo(%%a

  I find hard to do the next line
  find %2 %%a > parse_url.txt

)


GetHtml.vbs

Code: Select all

'GetHTML.vbs
URL = WScript.Arguments.Item(0)

Set WshShell = WScript.CreateObject("WScript.Shell")

Set http = CreateObject("Microsoft.XmlHttp")
http.open "GET", URL, FALSE
http.send ""
WScript.echo http.responseText




Regards
Dario

darioit
Posts: 230
Joined: 02 Aug 2010 05:25

Re: Parse url in htm page

#2 Post by darioit » 14 Nov 2011 09:01

New example for search pattern and parse result

go.bat http://www.microsoft.com/en-us/default.aspx msdn

Result:
http://msdn.microsoft.com/en-us/evalcenter/default.aspx
.................
and many other url


Regards

Post Reply