0

I'm trying to parse information from fonefinder.net. I was trying to use simplexmlload_file, but couldn't get the page to load successfully.

Now, I'm looking into Curl. But I'm not sure if this will work either.

I basically just want to take the html from the fonefinder page, and parse it to get phone carrier and city.

Is that possible? How?

2 Answers 2

1

SimpleXML will only work if the HTML is formatted correctly - and that is rarely the case ;) You could do a simple cURL call to fetch the data and the easiest thing would probably be using a regular expression to get the information you need.

The solution however is not easy to supply you with, with nothing to go on. But this was an idea.

Sign up to request clarification or add additional context in comments.

Comments

0

I Recommend using:

http://www.de.php.net/manual/en/function.file-get-contents.php to get the document

http://www.php.net/manual/en/domdocument.loadhtml.php to load it

http://www.php.net/manual/en/class.domxpath.php to get the information from it

Or use the search function here, that question must have been asked over and over, for example PHP: Fetch content from a html page using xpath()

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.