Retrieving innerHTML with cURL?


Posted on 16th Feb 2014 07:03 pm by admin

Hey all (sorry I know I'm a leecher, but I soon won't be. This is my first PHP project, but not my last ).

I need help with a little problem I am having. I am using cURL to navigate through some pages to validate a login and download some sources there. What I need to do is search through the tags of these sources to parse data within them. For instance

Did you know?Explore Trending and Topic pages for more stories like this.
Code: [Select]<table width="195" border="0" align="left" cellpadding="0" cellspacing="0" class="data_table">

I need to get that element so that I can get the values inside of the table.

The problem lies in the fact that i am using cURL to do this. since it is not in my document, I cannot say

Code: [Select]document.getElementByTagName('table');

or whatever. I need to make document from the source that I get from the cURL. here is my current code -

Code: [Select] //This is all code which reads the file of the website and puts the information in $data
//I am positive it works because when I echo $data, the information loads (in encoded form)

$data = curl_exec ($ch);
echo $data;
$params = $data->getElementsByTagName('data_table');


Apparently I cannot use $data and then get the elements. Does anyone have any ideas?
No comments posted yet

Your Answer:

Login to answer
77 Like 54 Dislike
Previous forums Next forums
Other forums

How do I create a 2D game "camera" to follow player?
In J2ME programming I'm targeting MIDP 2.0 devices.

I'm using gamecanvas and I was thinking t

Need help in Generating Combinations
Need help generating all possible combination of names in an array

Lets say i have the follow

Passing JS to PHP
So I have the following
Code: <?php
getdetails(?><script type="text/

Passing variables with pagination - iterating through unique id per link
Hi everyone,
I have seen a few topics like this one. Still cant find the specific thing, so I am

Alterar a hora do servidor
Se alguém souber, ajude-me a adicionar 6 horas, obrigado
<tr>
&

Database/Table Collation
What is the Database, and table collations used for? i don't understand what there used for since co

php forms and database navigatio
Hello,
I'm new to php and i'd like to post the following.
I have written code to get records f

that old Malformed Headers problem again!!!!! HELP!!!!!!
I've read the http://www.phpfreaks.com/forums/index.php/topic,37442.0.html

I don't think my c

Relative path
I have a absolute path to an image - like so: C:/Program Files/Apache Software Foundation/Apache2.2/

check if value exists
I have googled this for a while and I am getting lots of different results. Is there a standard meth

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash