sending data to internet page clicking button

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
chngrcn
Posts: 190
Joined: 29 Feb 2016, 08:55

sending data to internet page clicking button

19 Mar 2018, 01:20

Hello there.
I want to send data to TextBox with the help of "ahk" to a certain internet page and click on the button.

for example;

https://duckduckgo.com/

The html code of the search box on the internet page is as follows;

Code: Select all

<input id="search_form_input_homepage" class="js-search-input search__input--adv" type="text" autocomplete="off" name="q" tabindex="1" value="" autocapitalize="off" autocorrect="off">
Name of search box: "q"

this is the html code of the search button on this page ..

Code: Select all

<input id="search_button_homepage" class="search__button  js-search-button" type="submit" tabindex="2" value="S">
Name of search button: "search_button_homepage"

I want to work with the code, not the mouse coordinates, the textbox and the search button, which have these names directly.
Thanks for your help.
User avatar
divanebaba
Posts: 805
Joined: 20 Dec 2016, 03:53
Location: Diaspora

Re: sending data to internet page clicking button

19 Mar 2018, 23:56

Hello chngrcn.

There is a way to control search engines by url.
Some search engines have the term to search for in their url.
For example, when I'm looking for "Hot girls from israel", the url of duckduckgo looks like below: "https://duckduckgo.com/?q=Hot+girls+from+israel&ia=web"
So you just have to create such an url. Look code example:

Code: Select all

Gui, add, Edit, w200 vSearchterm
Gui, show,, Searcher
return

#if WinActive("Searcher")
Enter::
GuiControlGet, myterm,, Searchterm
Gui, hide
StringReplace, myTerm, myTerm, A_Space, +, All
myTerm := "https://duckduckgo.com/?q=" myTerm
run % myTerm
exitapp
return
#if
Einfach nur ein toller Typ. :mrgreen:
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: sending data to internet page clicking button

20 Mar 2018, 00:13

divanebaba wrote:Hello chngrcn.

There is a way to control search engines by url.
Some search engines have the term to search for in their url.
For example, when I'm looking for "Hot girls from israel", the url of duckduckgo looks like below: "https://duckduckgo.com/?q=Hot+girls+from+israel&ia=web"
So you just have to create such an url. Look code example:

Code: Select all

Gui, add, Edit, w200 vSearchterm
Gui, show,, Searcher
return

#if WinActive("Searcher")
Enter::
GuiControlGet, myterm,, Searchterm
Gui, hide
StringReplace, myTerm, myTerm, A_Space, +, All
myTerm := "https://duckduckgo.com/?q=" myTerm
run % myTerm
exitapp
return
#if
Assuming it isn't a search engine, how would you go about doing the same thing?
I am your average ahk newbie. Just.. a tat more cute. ;)
User avatar
divanebaba
Posts: 805
Joined: 20 Dec 2016, 03:53
Location: Diaspora

Re: sending data to internet page clicking button

20 Mar 2018, 00:26

Nwb wrote:... Assuming it isn't a search engine, how would you go about doing the same thing?
I don't know. Can you teach me?
Einfach nur ein toller Typ. :mrgreen:
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: sending data to internet page clicking button

20 Mar 2018, 02:51

divanebaba wrote:
Nwb wrote:... Assuming it isn't a search engine, how would you go about doing the same thing?
I don't know. Can you teach me?
No clue lol, but I thought you could do it using inspect elements or something, via ahk.
I am your average ahk newbie. Just.. a tat more cute. ;)
User avatar
divanebaba
Posts: 805
Joined: 20 Dec 2016, 03:53
Location: Diaspora

Re: sending data to internet page clicking button

20 Mar 2018, 07:16

Nwb wrote: No clue lol, ...
:D :D I'm sorry. I'm just an uneducated idiot. :crazy: :crazy:
Here is an example of an educated idiot. :mrgreen: :mrgreen: :mrgreen:
Einfach nur ein toller Typ. :mrgreen:
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: sending data to internet page clicking button

20 Mar 2018, 12:21

divanebaba wrote:
Nwb wrote: No clue lol, ...
:D :D I'm sorry. I'm just an uneducated idiot. :crazy: :crazy:
Here is an example of an educated idiot. :mrgreen: :mrgreen: :mrgreen:
Eh? Ugh I'm just gonna go n' see some com tutorials on youtube lol.
I am your average ahk newbie. Just.. a tat more cute. ;)
chngrcn
Posts: 190
Joined: 29 Feb 2016, 08:55

Re: sending data to internet page clicking button

23 Mar 2018, 05:22

divanebaba wrote:Hello chngrcn.

There is a way to control search engines by url.
Some search engines have the term to search for in their url.
For example, when I'm looking for "Hot girls from israel", the url of duckduckgo looks like below: "https://duckduckgo.com/?q=Hot+girls+from+israel&ia=web"
So you just have to create such an url. Look code example:

Code: Select all

Gui, add, Edit, w200 vSearchterm
Gui, show,, Searcher
return

#if WinActive("Searcher")
Enter::
GuiControlGet, myterm,, Searchterm
Gui, hide
StringReplace, myTerm, myTerm, A_Space, +, All
myTerm := "https://duckduckgo.com/?q=" myTerm
run % myTerm
exitapp
return
#if

It was not what I wanted.
I want to send data to the TextBox with the method "getElementID", click on the but button, checkbox checked.

ie located on the web page,
TextBox,
CheckBoxes,
button,
I want to run the elements like code ..


I want help with this issue .
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: sending data to internet page clicking button

23 Mar 2018, 06:03

chngrcn wrote:
divanebaba wrote:Hello chngrcn.

There is a way to control search engines by url.
Some search engines have the term to search for in their url.
For example, when I'm looking for "Hot girls from israel", the url of duckduckgo looks like below: "https://duckduckgo.com/?q=Hot+girls+from+israel&ia=web"
So you just have to create such an url. Look code example:

Code: Select all

Gui, add, Edit, w200 vSearchterm
Gui, show,, Searcher
return

#if WinActive("Searcher")
Enter::
GuiControlGet, myterm,, Searchterm
Gui, hide
StringReplace, myTerm, myTerm, A_Space, +, All
myTerm := "https://duckduckgo.com/?q=" myTerm
run % myTerm
exitapp
return
#if

It was not what I wanted.
I want to send data to the TextBox with the method "getElementID", click on the but button, checkbox checked.

ie located on the web page,
TextBox,
CheckBoxes,
button,
I want to run the elements like code ..


I want help with this issue .
Here is an example script. Script opens duckduckgo in internet explorer and asks you what you want to search, writes that to the input like you said, and then clicks on the search button after 1second. VOILA it's magik!

Code: Select all

pwb := ComObjCreate("InternetExplorer.Application") 
pwb.visible:=true 

pwb.Navigate("DuckDuckGo.com") 

while pwb.busy or pwb.ReadyState != 4 
	Sleep, 100

InputBox, LOL, Search DuckDuckGo, What would you like to search?
pwb.document.getElementByID("search_form_input_homepage").Value := LOL 

Sleep 1000


pwb.document.all.search_button_homepage.click() 

return

Now tell us what exactly you want.
I am your average ahk newbie. Just.. a tat more cute. ;)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 299 guests