www.webdeveloper.com
Results 1 to 5 of 5

Thread: Figuring out what info a form sends to webpage

  1. #1
    Join Date
    Mar 2014
    Posts
    3

    Figuring out what info a form sends to webpage

    Hi,

    im a webdevelopment noob and am not really developing a website or anything but am trying to write a program that sends info (like traveldate etc) to travelsites and evaluates the prices the sites show in return.

    Now i started with this site:
    www.skyscanner.de, whos source code tells me the used form uses a "post" method to send the entered data to the next site.

    HTML Code:
    <form action="/r/Search/" class="clearfix" id="search-controls-form" [B]method="post"[/B]>        <div class="row">
                <div class="two-col-layout" id="departure">
                    <label for="departure-input">Von</label>
                    <input name="departure-input" id="departure-input" tabindex="1" type="text" list="departure-list" autocomplete="off" placeholder="Land, Stadt oder Flughafen eingeben" 
                           autocorrect="off" autocapitalize="off" spellcheck="false">
                    <span id="departure-input-helper" class="input-helper"></span>
                </div>
                <span id="controls-swap" title="Klicken Sie hier, um den Abreise- und Ankunftsort zu tauschen.">
                    <span class="hidden">Klicken Sie hier, um den Abreise- und Ankunftsort zu tauschen.</span> 
                </span>
                <div class="two-col-layout" id="destination">
                        <span id="map-anchor"><a href="/karte-fuer-billigfluege">Karte</a></span>
                    <label for="destination-input">Nach</label>
                    <input name="destination-input" id="destination-input" tabindex="2" type="text" list="destination-list" autocomplete="off" placeholder="Land, Stadt oder Flughafen eingeben" 
                           autocorrect="off" autocapitalize="off" spellcheck="false">
                    <span id="destination-input-helper" class="input-helper"></span>
                    <div id="prefer-directs-toggle" class="clearfix">
                        <input type="checkbox" tabindex="3" name="prefer-directs" id="prefer-directs-input">
                        <label for="prefer-directs-input">Direktverbindung bevorzugt</label>
                    </div>
                </div>
            </div>
            <div class="row">
                <div id="journey-details">
                    <div id="journey-type-toggle" class="clearfix">
                        <input type="radio" tabindex="4" value="1" name="journey-type" id="journey-type-return" checked="checked">
                        <label for="journey-type-return">R&#252;ckreise</label>
                        <input type="radio" tabindex="4" value="0" name="journey-type" id="journey-type-oneway">
                        <label for="journey-type-oneway">Nur Hinreise</label>
                    </div>
                    <div id="journey-date-container" class="clearfix">
                        <p class="label">Hinreise</p>
                        <div class="journey-date">
                            <label for="departure-date-calendar" class="hide">Abreisedatum</label>
                            <input name="departure-date-calendar" id="departure-date-calendar" tabindex="5" class="datepicker" autocomplete="off" type="text" placeholder="Abreisedatum">
                            <span id="depart-date-desc" class="label"></span>
                        </div>
                        <div class="journey-date journey-date-return">
                            <label for="return-date-calendar" class="hide">R&#252;ckreisedatum</label>
                            <input name="return-date-calendar" id="return-date-calendar" class="datepicker" tabindex="6" autocomplete="off" type="text" placeholder="R&#252;ckreisedatum">
                            <span id="return-date-desc" class="label"></span>
                        </div>
                    </div>
                </div>
                <div id="cabin-class-passenger-info-container" class="clearfix">
                    <div id="passenger-container" class="clearfix">
                        <div id="passenger-number-container" class="clearfix">
                            <p class="label">Reisende</p>
                            <div class="passenger-info">
                                <span class="passenger-adult"><input type="number" pattern="\d+" tabindex="7" maxlength="1" value="1" id="passenger-info-adult"></span>
                                <label for="passenger-info-adult">12+ Jahre</label>
                            </div>
                            <div class="passenger-info">
                                <span class="passenger-child"><input type="number" pattern="\d+" tabindex="8" maxlength="1" value="0" id="passenger-info-child"></span>
                                <label for="passenger-info-child">unter 12</label>
                            </div>
                            <div class="passenger-info  passenger-info-last">
                                <span class="passenger-infant"><input type="number" pattern="\d+" tabindex="9" maxlength="1" value="0" id="passenger-info-infant"></span>
                                <label for="passenger-info-infant">unter 2</label>
                            </div>
                        </div>
                    </div>
                    <div id="cabin-class-container" class="clearfix">
                        <p class="label">Kabinenklasse</p>
                        <select id="cabin-class" tabindex="10">
                            <option value="Economy">Economy</option>
                            <option value="PremiumEconomy">Premium Economy</option>
                            <option value="Business">Business Class</option>
                            <option value="First">First Class</option>
                        </select>
                    </div>
                </div>
            </div>
            <div id="search-ancillaries" class="row last clearfix">
                    <ul id="search-compare-units" class="compare-units-container icon-free-list clearfix hide">
                        <li class="label">Preis-Check (neue Fenster)</li>
                        <li class="template">
                            <input id="compare-unit-key" class="compare-unit-checkbox compare-unit-key" tabindex="11" type="checkbox">
                            <label for="compare-unit-key">labelValue</label>
                        </li>
                    </ul>
                <div id="search-controls-container">
                    <button tabindex="20" type="submit" id="search-controls-button" class="large-button">
                        <span class="button-text">Suchen</span>
                        <span class="button-spinner">&nbsp;</span>
                    </button>
                </div>
            </div>
    </form>
    I tried using fiddler 2, firefoxes own network analysis tools and firebug to find out what info the post-command actually sends but i only see "get" requests once i hit the "submit" button.
    How is this possible? and how can i find out what infos to send?

    Thanks for any help

  2. #2
    Join Date
    Feb 2014
    Location
    Canada
    Posts
    155
    The purpose of using the post method is to prevent the information from being readily accessible to others. The get method will show up in the URL and can be easily read. For example, if you go to a particular post on these forums, there will be a unique ID and will show up in the URL (get method). On the other hand, if you're doing online purchases, you're not going to see your information in the URL (post method).

    I suppose the biggest question to me is, if you want to see the prices, why not scrape the website (i.e. send the actual information, let it be processed, grab the results and show them to the user)?

  3. #3
    Join Date
    Mar 2014
    Posts
    3
    Quote Originally Posted by Error404 View Post
    The purpose of using the post method is to prevent the information from being readily accessible to others. The get method will show up in the URL and can be easily read. For example, if you go to a particular post on these forums, there will be a unique ID and will show up in the URL (get method). On the other hand, if you're doing online purchases, you're not going to see your information in the URL (post method).

    I suppose the biggest question to me is, if you want to see the prices, why not scrape the website (i.e. send the actual information, let it be processed, grab the results and show them to the user)?
    I understand the reason for the use of the post method, but i cannot see it being used when i use analyzertool such as fiddler 2 or firebug. Which makes me wonder why thats the case.

    I tried to just fill the form and asked about it in a different forum where i was told it would be smarter to just fetch the "post"-info send to the server and send that message directly (instead of filling the form and submitting it) and then grab the results.

    My question remains unanswered: Why does the method state "post" yet i cannot see a post-message being send to the server?
    Thank you for your help anyway

  4. #4
    Join Date
    Feb 2014
    Location
    Canada
    Posts
    155
    I still don't understand the benefit of doing it the way you described but Firebug will not be able to do that for you. Instead, try out TamperData. I haven't used it but from the description, it might let you achieve what you're after.

  5. #5
    Join Date
    Mar 2014
    Posts
    3
    Quote Originally Posted by Error404 View Post
    I still don't understand the benefit of doing it the way you described but Firebug will not be able to do that for you. Instead, try out TamperData. I haven't used it but from the description, it might let you achieve what you're after.
    Thanks, but this does not show me any "post" either.
    How can this be? The html code clearly shows a postmethod yet i cannot detect a postmethod being sent?!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles