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

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 to add advertisment on top of videos
Hello,
I was told that i should find the answer for this problem in this forums.
I searched a

Odd or Even
Inside of a while loop I need to echo several rows of info...easy enough.

In the loop (for th

Access website from only 1 computer...?
One of my customers wants his website to only be accessed by people in which they bought the website

frames get header location..
i have two frames, one top, one bottom. how do i do a form on the bottom frame that gives me the ur

JSON SORT WITH PHP
I have two products that I want to sort by say "Id:17, value: xxx" using php
The page w

validating url
im trying to validate url's sent to me by a form
the url's im collecting are for placing banners

Upload file and add HTML
Hey everyone,

I have a client has meeting agendas and minutes that should be posted online. I

Help Ordering Arrays
Hi, I have 3 arrays as shown below.

Code: $users = $this->get_latest_users();
$flir

login and redirect
hello! can someone help me.. can you give me an idea.. I want to make a login page and redirects it

Windows Authentication
I have a website which is windows authenticated.
now i want something more on this application.<

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