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?

77 Like 54 Dislike
Previous php-forum Next php-forum
Other php-forum

Adding to an Int row in db
Hi, i have a database which houses all of the users of my site. One of the columns is for points whi

Preg_match with an array
is there an away to use preg_match with an array?

i want to check a string with an array to s

extract data
Code: <div class="post hentry uncustomized-post-template">

FILTER_CALLBACK -- Files?
Hi All,

I'm using the php filter functions to validate my form data. For custom filters, I'm

mysql_real_escape_string making variable equal nothing
i post a form and i post the variable:
Code: $var = $_POST[variable];then i echo $var its what i

Simultaneous select/update/insert
Hi

How would I need to go about when 2 users update a single row simultaneous? And how would

fwrite error
Hi All,
Does anyone know what is causing the error in this code?

Code: <?
$error

Problem!
I have another problem, when i run this code i get this error "Parse error: syntax error, unexp

SHOW TABLES Help
Hi all

I have the following

Code: [Select]<?php
$sql = "SHOW TABLES&quo

Loops and Classes
I am making a template system and everything seems to be going well up until I have to loop in a var

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