Script to take page data in Php or python

Asked

Viewed 673 times

0

I want to implement a script that accesses the printer page here of my work and take the data as for example, number of impressions, user names, basically I want to create a control system.

Where I start, I wanted to do in php, but I know that python should be easier mt and should have libraries ready for this.

There is a page that I managed to capture the javascript and redoing I arrive at the page where I want to capture the data.

On another site, I can’t see the event when I click on the menu, as I can see this ?

  • 1

    Welcome to [en.so]. As it is new here, I strongly recommend that you start doing the [tour] to at least understand the basics of how the site works. Also read the [Ask] guide. As it stands, your question is too wide and may be closed very soon.

  • Perfect, I’ll rephrase the question.

1 answer

0

You can use Curl (search for more options):

First see if Curl is enabled:

The php info option should show the

<?php info()
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://sounoob.com.br/labs/pagseguro-test-
curl');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
curl_close($ch); ?>

With this you get a string with the result of the page.
That way php allows you manipulate the page DOM and extract the data as you wish. You could also make a script using Ajax to extract the data from the pages you want, if you don’t have any settings that block this access.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.