$url = (anURL);
$res = file_get_contents($url);
Let's say this link led to a profile of some guy, how would I get let's say...the description/blurb of him? Specific content..Because $res returns the whole thing.
How do I get specific content from a page?
Post a Reply
|Oldest Newest Rating|
· December 25, 2014
I've done this with the DomDocument class. As mentioned above you will have to inspect the page to find out exactly what you are looking for.
Here is a pretty good tutorial on how to use the DomDocument class to get information from a web page.
· December 12, 2014
I have never done it, but I'll try to help as much as I could.
If you know exactly what website is going to be checked, you may want to inspect it (you know, browser inspector) and get to the description [html] div name. After that, use RegEx to (or any other tool that can) filter out everything in between the tag:
In meantime, I'll play with this way of getting content from a website because I think it's interesting, and will link you the result if I make it.