auto click on third party website picking up the boot and storing in variable

Asked

Viewed 69 times

0

For you to understand:

Hello good night, I’m finishing a programming course and this is my web work in construction http://www.indicovoce.esy.es even well, I am studying Java Script and Jquery and with the study of auto click, without further delay. I want to create a code for auto click on third party website, and that third party website in case is my indicovoce. I created another site to using the command of php file_get_contents to get the page I want, with the code in hand to get a specific part to using

$pattern = "/Inscreva-se/i"; 
if pegou alguma informações
if ($resultado >= 1) {
print "funcionou";
echo ' <script>
window.setTimeout(function(){
document.getElementById("botao_2").click();*   <-- esse é o comando do click.

}, 500);
</script>';
var_dump($matches);

EDIT: as far as I have researched, it is not possible to auto click on a third party website, because the page needs to have a code java script, so I thought to store the code of the button in a variable and try to trigger there, it will be possible?

I hope that it was clear, that you can help thank you very much.)

PHP:

<?php
echo ' <script src="jquery-2.0.3.js"></script>';
$url = file_get_contents('http://www.indicovoce.esy.es/_cadastro/cad_cliente.php');
$pattern = "/Inscreva-se/i";
$matches = array();

# Executa nossa expressão
$resultado = preg_match_all($pattern, $url, $matches);

if ($resultado >= 1) {
    print "funcionou";
echo '  <script>
         window.setTimeout(function(){
                document.getElementById("botao_2").click();

            }, 500);
        </script>';
    var_dump($matches);

} else if ($resultado === 0) {
    print "nãofuncionou";
    var_dump($matches);
    preg_last_error();

} elseif ($resultado === false) {
    print "ocorreu um erro";

}

?>
  • Marlos, your question is a little fuzzy, although I can see the general intent. I would suggest a read on the [Tour], on [Ask] and then calmly on [Help] for a better use of the site. Remembering that you can always [edit] your posts to make the necessary adjustments or add-ons.

  • I researched and I did not find anything of the type to store the button code in a variable and there to trigger the auto click. I tried and it didn’t work, but I was wondering if it’s possible.

No answers

Browser other questions tagged

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