Follow us on Twitter!
Imagination is more valuable than knowledge - Albert Einstein
Monday, April 21, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 30
Guests Online: 27
Members Online: 3

Registered Members: 82858
Newest Member: alexxkim
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

Regular Expressions


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 16-08-08 22:02
Hello ladies and gentlemen. School has started this year, and I am on an advanced team(arrived late). We have been given perhaps over 200+ words to define by Monday and instead of doing that, I decided to write a Python script that will allow me to type the words and rip the definitions from http://www.dictio. . .. I noticed that it basically follows this pattern http://dictionary.com/search?q=(word). I wrote a script that gets the definitions, but now I need to be able to get the actual definitions and not the source code. The definitions that I need are located between
Code

<td valign="top">




and
Code

</table>




tags

Here is my script:
http://pastebin.c. . .

The source code for an actual page of dictionary.com
http://pastebin.c. . .


Author

RE: Regular Expressions

spyware
Member



Posts: 4192
Location: The Netherlands
Joined: 14.04.07
Rank:
God
Warn Level: 90
Posted on 16-08-08 22:06
Select everything between, and including those two tags, then strip the tags.



img507.imageshack.us/img507/3580/spynewsig3il1.png
"The chowner of property." - Zeph
[small]
Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term.
- Carl Sagan
“Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor?” - Ebert
[/s

Edited by spyware on 16-08-08 22:12
http://bitsofspy.net
Author

RE: Regular Expressions


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 16-08-08 23:07
Perhaps this:
Code
<table class="luna-Ent"><tr><td valign="top" class="dn">[0-9].</td><td valign="top">(.*)</td></tr></table>




it's eregi, not preg.

get match 2 (starts at 0) then strip tags aswell.


Author

RE: Regular Expressions


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 16-08-08 23:36
Thanks guys, I managed to get it working when I stumbled on an old IBM article I didn't even have to use reg expressions. I'm going to put this in the code bank and credit you guys if it is up.


Author

RE: Regular Expressions

fashizzlepop
Member



Posts: 482
Location: Old folks home.
Joined: 08.04.08
Rank:
Moderate
Posted on 17-08-08 01:01
Thats sounds like a really helpful script I would use during school. Can you post the complete source if the code bank dont work?


"The definition of insanity is doing the same thing over and over again and expecting different results.”
~Albert Einstein~


csullivan.codeinspire.net/images/boomsig2.png
fashizzlepop@gmail.com http://csullivan.codeinspire.net/
Author

RE: Regular Expressions


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 17-08-08 15:19
fashizzlepop wrote:
Thats sounds like a really helpful script I would use during school. Can you post the complete source if the code bank dont work?

The link is here: http://pastebin.c. . . and it is in the code bank as well B)
I'll be doing some more tweaking throughout the weekend as well so that it can read definitions from files, and be more efficient at removing HTML