Free2Code
The majority of forums are now only available as archives, which means posting/editing is disabled.

The Anything and Everything forum is still open.
 
Time: 2013-05-18, 08:50pm
No Subject
Subject: No Subject  ·  Posted: 2004-04-08, 09:22am
Rank: Unregistered
I'm trying to get information from a webpage.
I have to get a certain line out the information.

this is some of the info downloading from the site :
[quote]
Please wait while we transfer you...<br /><br />
(<a href='http://forums.invisionpower.com/index.php?s=a879884673ed47dcca8fd8c50e843da4&amp;act=Search&CODE=simpleresults&sid=796cd05a6e2a84ff5504ffec224403aa&highlite=test'>Or click here if you do not wish to wait</a>
</td>
[/quote]

So each line gets put in a var with /sockread
and now i have to get information from that second line. but how do i do this? (i would need the /index.php?s=a879884673ed47dcca8fd8c50e843da4&amp;act=Search&CODE=simpleresults&sid=796cd05a6e2a84ff5504ffec224403aa&highlite=test' part.
i tryed this (that $chr(40) is an "(" ):
[quote]if ( * $chr(40) $+ <a href=' * iswm %') [/quote]

but it dossen't work.
anyone ?

full code :
Code:
  1. alias 12 sockopen req_search forums.invisionpower.com 80
  2. on *:sockopen:req_search:{
  3.   sockwrite -n $sockname GET /index.php?act=Search&CODE=simpleresults&mode=simple&forums=all&keywords=test HTTP/1.1
  4.   sockwrite -n $sockname Host: forums.invisionpower.com $+ $crlf $+ $crlf
  5. }
  6. on *:sockread:req_search:{
  7.   if ($sockerr) {
  8.     echo -a Error.
  9.     halt
  10.   }
  11.   else {
  12.     var %'
  13.     sockread %'
  14.     if (* $chr(40) $+ <a href=' * iswm %') {
  15.       ; if ($wildtok(%',* $chr(40) $+ <a href=*, 1, 32) != null ) {
  16.       echo line : %'
  17.     }
  18.    ; following outputs the whole page to window
  19.     window @nfo
  20.     aline @nfo %'
  21.     if (</html> iswm %') {
  22.       sockclose $sockname
  23.     }
  24.     ;halt
  25.     ;}
  26.   }
  27. }


Thank you.

this has been crossposted to mircscripts.org
 
  Reply to this ·  Post link ·  Top
Subject: Re: No Subject  ·  Posted: 2004-04-09, 03:13am
Rank: Unregistered
found it : if ( <span class $+ $chr(61) $+ $chr(39) $+ desc $+ $chr(39) style isin %' ) {
stuff like that works
 
  Reply to this ·  Post link ·  Top

Pages: 1

Please login or register to post a reply.

Penguino AVR

Want to learn about robotics or microcontrollers?
Check out the Penguino AVR from our friends at
Icy Labs