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

Getting rid of quotes when printing data
Hi Guys, I use the filter_var FILTER_SANITIZE_STRING to filter the textarea input. The function esca

2 decima places & How to reload my page
Hello There,

How do i put full-stop (.) after second figure from behind? ie if i have 123456

Error: SQL Syntax; Line 1
Code:

<?php require "global_settings.php"; ?>
<title&g

php ajax - two drop down list with a submit button
i have created a form with 2 drop-down list and a submit button. I would like to know how to pass th

Confusing Functions
So, I've been reading up on Functions and I like them! However, I need some help using variables in

CHECK A STRING FOR ' " ' (DOUBLE QUOTES)
I am checking for delimiter (.!?) and if there is a " after a sentence then it should neglect a

Ajax Issues - Update Panel / Timer. Intellisense doesn't know about them
Type 'System.Web.UI.ScriptManager' does not have a public property named 'UpdatePanel'. That is wha

Need help-Error istream header declaration
Hi Everyone ,

I am having issue with istream declaration. I am new to C programming.
can a

Call to undefined function mysql_fetch_accoc()
New to php/mysql coding. What's wrong with this sequence, or am I
just not seeing to obvious?

socket communication between c++/java and sending image
hi,

i have a class in c++ called win32_sockserver which creates socket to java. i am trying

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