HTML PUT and GET

Hi there,

I am new to the whole thing :) read n00b 101 hehe

Currently I am requesting sending a requests.get() to a html page. If I now print(r.text) the output shows the whole page.

The page has query section in which the request range can be set:

![request range](https://cloud.githubusercontent.com/assets/11629690/7910409/ab72b976-0854-11e5-9cd6-8f37b831dab3.png)
1. Is there a way for me to send the range required?

Then the data gets displayed:

![request data](https://cloud.githubusercontent.com/assets/11629690/7910443/ffaa998c-0854-11e5-939b-56311404cfaf.png)
1. Is there a way for me to only return this data?

At the moment, I can see the data in the text that is returned:

<tbody>

```
    <tr class="even">
        <td>
        <input type="checkbox" class="noborder"
               name="paths:list" id="cb_1566205447"
               value="1566205447"
               title="Select Channel 8"
               alt="Select Channel 8" />
        </td>
        <td style="text-align:left">May 31, 2015 11:30 am</td>
        <td style="text-align:right">2.28839</td>
    </tr>
```

And here is the code returned for the range request:

</select>
      </span>

```
  <span>:</span>

  <span>
<select name="end_query_minute"
     id="date_select_form_end_query_None_minute"
     size="1"
     onchange="update_date_field('date_select_form_end_query_None','date_select_form_end_query_None_year','date_select_form_end_query_None_month','date_select_form_end_query_None_day','date_select_form_end_query_None_hour','date_select_form_end_query_None_minute','date_select_form_end_query_None_ampm')">

  <option value="00">--</option>
  <option value="00">00</option>
  <option value="05">05</option>
  <option value="10">10</option>
  <option value="15">15</option>
  <option value="20">20</option>
  <option value="25">25</option>
  <option value="30">30</option>
  <option value="35 selected="selected"">35</option>
  <option value="40">40</option>
  <option value="45">45</option>
  <option value="50">50</option>
  <option value="55">55</option>

</select>
```

I am guessing that I can set the range using some code that will set the "end_query_minute" (and all other request range variables) and then query the page right after that to return the appropriate range of data. I can then extract the data using another method from the text returned... but I cannot find any relevant documentation on hoe Requests handles data/returns data/etc...

Any help would be highly appreciated.

A big thanks for this development, it has thus far made my life much easier :)

Regards,


So, requests doesn't know anything about HTML. This means there's no programmatic code you can use to simply interact with that page by searching through the HTML.

However, you can form the same requests that your browser would do. If you hit F12 in your browser it should bring up a developer console that you can use to see all the HTTP requests your browser makes. If you then fill out the forms and submit them, you can see the way the data is structured and replicate that in requests.

If you want to follow this up, though, I recommend you ask a question on [StackOverflow](http://stackoverflow.com/). That is a community focused on providing answers to questions like this one, while this bug tracker is mostly to track actual bugs in requests.


Kief,

Sorry for the post :) Thanks for the advice


Hi Lukasa,

Even though this isn't the place, I decided to post the answer to my question, in case someone else comes a looking:

payload = {'start_query': '2015-05-30 10:30:00 GMT+2', 'end_query': '2015-05-30 15:30:00 GMT+2'}

r = s.get(url, params=payload)

Regards,


@RubenvWyk Thanks for the follow-up! :cake: