Jump to content


Photo

parsing the PHP web reference site


  • Please log in to reply
3 replies to this topic

#1 help_me_with_php

help_me_with_php

    Advanced Member

  • Members
  • PipPipPip
  • 64 posts
  • LocationIowa, USA

Posted 22 March 2013 - 11:03 PM

hello everyone,

 

this isn't really a coding question but couldn't find a forum for it.  here is a webpage I would love to parse out and get only the relevant information out of it:

 

http://php.net/quickref.php

 

does anyone here know of any good tools to do such a thing?  basically what I'm looking for is a parser, essentially.  I can write a script in windows and use the client side coding to find the script text that I was to single out but that would take quite a bit of work by hand.

 

has anyone done this kind of thing before?



#2 requinix

requinix

    Hopeless Member

  • Moderators
  • 5,989 posts
  • LocationWA

Posted 22 March 2013 - 11:30 PM

You want a list of functions?

Load up the page in DOMDocument, getElementById() for "quickref_functions" (it's a UL), and from that a getElementsByTagName() with "a" to get all the links. Then loop over that list.
When in doubt, CHECK YOUR ERROR LOG

#3 help_me_with_php

help_me_with_php

    Advanced Member

  • Members
  • PipPipPip
  • 64 posts
  • LocationIowa, USA

Posted 22 March 2013 - 11:46 PM

You want a list of functions?

Load up the page in DOMDocument, getElementById() for "quickref_functions" (it's a UL), and from that a getElementsByTagName() with "a" to get all the links. Then loop over that list.

thanks so much for your help.  I don't think I communicated clearly.  "What I want to do is get some extracted information from the pages that are pointed to by each of those links.   does that make sense?  so that page is not what I'm after...it's the content on all of the linked pages that I'm after.  all of the pages look the same so it shouldn't be too difficult.

 

I guess the question is more or less, do I have any other tools to work with besides programming in a languages of my choice and just using the DOM document model?  thanks.



#4 requinix

requinix

    Hopeless Member

  • Moderators
  • 5,989 posts
  • LocationWA

Posted 23 March 2013 - 12:26 AM

Reflection is a lot easier to use. Grab the list of functions and use reflection to get information about them. That can get you pretty much anything you might want.
When in doubt, CHECK YOUR ERROR LOG




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com