J
J
Jony13372016-11-07 19:17:11
PHP
Jony1337, 2016-11-07 19:17:11

How to parse a photo from the site if there is a form for receiving a photo?

Hello
, there is such a form on one site

<div class="row">
    <div class="col-md-8 col-xs-6" id="left-col">
      <div class="aplication">
        <div class="aplication-inner">
                <h2 class="title">Text !</h2>
        <p class="subtitle">Introdu numele tau</p>
        <form id="form1" class="formapp" method="post" action="http://www.example.com/tm1" name="userinput" enctype="multipart/form-data">
          <input type="hidden" value="sa" name="pic">
          <span class="input input--minoru fiir">
            <input type="text" name="nume" placeholder="Ex. Adrian" maxlength="14" class="input__field input__field--minoru">
            <label for="input-13" class="input__label input__label--minoru">
              <span id="nume-label" class="input__label-content input__label-content--minoru">Name</span>
            </label>
          </span>
          <span class="input select--monoru sec">
            <select name="sex" class="input__field input__field--minoru">
              <option value="masculin">Masculin</option>
                <option value="feminin">Feminin</option>							
            </select>
            
            <label for="input-13" class="input__label input__label--minoru">
              <span class="input__label-content input__label-content--minoru">Genul</span>
            </label>
          </span>
          <div class="submit-div">
            <input type="submit" class="submit" value="Find">
          </div>
                    
        </form>

after the Find button is pressed, we are redirected to the same address, just instead of the form, there is already a photo
how to parse this photo, who has any idea?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nurlan, 2016-11-07
@daager

curl'om helmet post and parse the issue.
file_get_contens helmet post and parse the output.
We go in with nightmarejs, click Find and parse the output.

I
Ilya, 2016-11-07
@glebovgin

Good afternoon.
As an option:

$post['pic'] = 'sa';
$post['nume'] = 'value';
$post['sex'] = 'masculin';

$ch = curl_init('http://www.example.com/tm1');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$result = curl_exec($ch);
curl_close($ch);

Next, look at $result for the presence of an image. Well, feel free to adapt the code to your needs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question