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

gmmktime or mktime
I live in the UK, i am within the GMT (with daylight saving time ie 1 hour difrence between summer a

How many users online in the last 24-hours using time()?
I'm fairly new to PHP. I have a MySQL table called 'users' and a field called 'loggedin' which is in

Why do I get this error
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/a5488351/public_html/b

Get word number x from string?
How can I use a function to loop through a string, and "have a look at" every word in the

Wrong Info sent Using $get in form
Hi i have this code that i tried to make to send some info from one page to aother with lots of ppls

Serial number of exernal hard disk/Thumbdrive
Hi guys, I am new tio java networking concepts.Please tel me how to get Serial number of exernal

Sessions work for me and not others?
I'm having a bit of bad luck with sessions. In the past they have worked fine for me, but this time

Checkbox info wont include in Mailto
Hey, im new to php.
Basically I have made a form to request which type of job(s) are needed, whic

AJAX form submit
I recently built a form that submits data to my database with an ajax function that is called throug

strtotime issue
Hey all,

I'm playing around with some code, and basically the idea is:

Person changes

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