Jump to content
UBot Underground

How To Fill Different Forms Having The Same Options With Different Values


Recommended Posts

Hello everyone, I'm trying to understand is possible to fill different html select having the same tipology of arguments but with values described in different ways, for example I have 2 forms in 2 different websites where the bot should book some rooms, in the bot interface the user can chose how many rooms to book, let me say the user chose to book 5 rooms, now the bot goes in the first website and find this selector:

 

Fist select in first website:

 

<select>

<option value="1room">1 room</option>

<option value="2rooms">2 rooms</option>

<option value="3rooms">3 rooms</option>

<option value="more rooms">More than 3 rooms</option>

</select>

 

In this selector the bot must chose the 4th option "More than 3 rooms" but in my bot I have stored the value "5 rooms".

 

In the second website I have a different select where I must chose "five places room" but again in the bot I have stored the value "5 rooms"

 

Second select in second website:

 

<select>

<option="">Chose how many rooms</option>

<option value="single room">single room</option>

<option value="double room">double room</option>

<option value="triple room">triple room</option>

<option value="four places room">four places room</option>

<option value="five places room">five places room</option>

</select>

 

 

Which is the best way to manage this situation?

 

 

In other bots I made before I used to use many IF

 

IF ("1 rooms") then select "single room"

IF ("2 rooms") then select "double room"

IF ("3 rooms") then select "triple room"

IF ("4 rooms") then select "four places room"

IF ("5 rooms") then select "five places room"

 

 

But sometime I have to fill many selects described differently for each website then I'm looking for a more efficient way to manage this situations...

 

Any suggestion?

 

Thank you!

Link to post
Share on other sites

I personally would do something like this,write a command,that clicks based on the number the user picks in the UI with the select,the only if's you will need to write would be some sites who's first option is Choose a Room,otherwise it will work fine

 

EDIT I mean the only if's would be,if "Choose A room" or " Pick room numbers" exists,remove it,then use my script change attribute outerhtml = nothing

 

check out this code

 

http://pastebin.com/raw/e42mKc59

Link to post
Share on other sites

Hi deliter, yes the way you suggested is a good starting point, supposing the value stay in the same position but what to do if I chose 5 rooms and I have this 2 selectors

 

<select>
<option="">Chose how many rooms</option>
<option value="single room">single room</option>
<option value="double room">double room</option>
<option value="triple room">triple room</option>
<option value="four places room">four places room</option>
<option value="five places room">five places room</option>
</select>
 

 

<select>
<option value="1 offer">1 to 3 rooms</option>
<option value="2 offer">4 to 8 rooms</option>
<option value="3 offer">9 to 15 rooms</option>
<option value="4 offer">More than 15 rooms</option>
</select>

 

In the first I would select the option number 6 but in the second select I must chose the option number 2.

 

I should find the way to define a command

 

Bot data: 5 rooms

 

Then filling the first select I should define:

 

1 room = single room

2 rooms = double room

3 rooms = triple room

4 rooms = four places room

5 rooms = five places room

 

filling the second select I should define:

 

1 room = 1 offer

2 rooms = 1 offer

3 rooms = 1 offer

4 rooms = 2 offer

 

5 rooms = 2 offer

 

and so on... what do you think?

 

How to reproduce this behavior with the script?

 

As usual, thanks to everyone!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...