Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(Solved)...get word from HTML
#1
Code:
Copy      Help
str a
Http b.GetUrl("http://www.google.com/search?hl=en&q=esract" &a)
out
out a
;Did you mean: </font><a href=/search?hl=en&safe=off&ie=UTF-8&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=extract&

Ok I want to pull a word out of HTML and that word would be 'x' the only thing I know about the word would be the HTML around it.

In the commented part of my code you can see the HTML that is around the word 'extract' that is the word I would like to pull but it will be changing, can this be done and if so how ?

I would post the whole HTML code but i dont want to fill up the page :!:.

I know I'm give alot of info but I dont know how else to ask this question.

Thanks.
#2
I may be able to help with this. I'm good with finding a word within a str's results. If that's what you need. If so could you give me a better idea of what you mean so I can help ya.

---
edit: let me refraise that, I know how to tell if the word 'extract' exists in all that html :?
#3
I would use findrx.

Code:
Copy      Help
str a=
;Did you mean: </font><a href=/search?hl=en&safe=off&ie=UTF-8&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=extract&
str b
if(findrx(a "\bDid you mean:.+?&q=([^&> '']+)" 0 0 b 1)<0) end "not found"
out b
#4
wow thanks alot, I was on the right track but I dont know how to use findx very well guess I need to read up on that.
#5
Ok I know I'm doing this all wrong lol but I'm trying to learn. I have been reading about Regular expression syntax, but I still haven't got it down to well could you please tell me what I'm doing wrong here.

I am trying to get the code between <BLOCKQUOTE>HERE<BLOCKQUOTE>
Function ( Function2 )
Code:
Copy      Help
str n a google="http://www.spellcheck.net/cgi-bin/spell.exe?action=CHECKWORD&string=runnning"
Http b.GetUrl(google &a)
if(findrx(a "\b<BLOCKQUOTE>([^[]]+).*<\/BLOCKQUOTE>" 0 0 n 1)<0) end "No Search Results"
out n
;<P><B>Here are some suggestions:</B><BLOCKQUOTE>
;running<BR>
;ruminating<BR>
;Rumanian<BR>
;rummaging<BR>
;rumbaing<BR>
;rumbling<BR>
;ruminatingly<BR>
;Rumanians<BR>
;rumblings<BR>
;rumoring<BR>
;rumpling<BR>
;rumination<BR>
;runnier<BR>
;rumrunning<BR>
;run<BR>
;</BLOCKQUOTE>
#6
Code:
Copy      Help
if(findrx(a "<BLOCKQUOTE>((?s).*?)</BLOCKQUOTE>" 0 0 n 1)>=0)
#7
Thank you.


Forum Jump:


Users browsing this thread: 1 Guest(s)