How can I search an HTML website for a keyword and paste that link in the search bar?










0














I am trying to make a textbox that extracts a word into a keyword in chrome. When i press a button the keyword in the textbox gets implemented into chrome and if that keyword is found, it then goes into that hyperlink.



The code is so far:



from tkinter import *
from tkinter.messagebox import *
import webbrowser

root = Tk()

url = 'https://shop.palaceskateboards.com/'

frame = Frame(root)
frame.pack()

def OpenUrl():
webbrowser.open_new(url)

button = Button(frame, text="Start", command=OpenUrl)

button.pack()

root.mainloop()









share|improve this question























  • Please provide more information. What do you mean by 'extracts a word into a keyword in chrome'? Which hyperlink are you talking about? Where does the word come from? Do you already tried some code? If so, please add it to your question.
    – Alex_P
    Nov 11 '18 at 15:12











  • I have made a textbox that i can write in, and i have a button. When i press the button, i want the text in the textbox to be implemented into chrome as a keyword. I am trying to make a bot for shop.palaceskateboards.com, written in python. And i want a keyword function that searches for a specific clothing piece.
    – Hugo Sigurdson
    Nov 11 '18 at 15:14







  • 2




    @HugoSigurdson when adding detail to your question, add it to the body of the question; comments aren't the correct place, and comments are much more limited in length and formatting
    – landru27
    Nov 11 '18 at 18:52















0














I am trying to make a textbox that extracts a word into a keyword in chrome. When i press a button the keyword in the textbox gets implemented into chrome and if that keyword is found, it then goes into that hyperlink.



The code is so far:



from tkinter import *
from tkinter.messagebox import *
import webbrowser

root = Tk()

url = 'https://shop.palaceskateboards.com/'

frame = Frame(root)
frame.pack()

def OpenUrl():
webbrowser.open_new(url)

button = Button(frame, text="Start", command=OpenUrl)

button.pack()

root.mainloop()









share|improve this question























  • Please provide more information. What do you mean by 'extracts a word into a keyword in chrome'? Which hyperlink are you talking about? Where does the word come from? Do you already tried some code? If so, please add it to your question.
    – Alex_P
    Nov 11 '18 at 15:12











  • I have made a textbox that i can write in, and i have a button. When i press the button, i want the text in the textbox to be implemented into chrome as a keyword. I am trying to make a bot for shop.palaceskateboards.com, written in python. And i want a keyword function that searches for a specific clothing piece.
    – Hugo Sigurdson
    Nov 11 '18 at 15:14







  • 2




    @HugoSigurdson when adding detail to your question, add it to the body of the question; comments aren't the correct place, and comments are much more limited in length and formatting
    – landru27
    Nov 11 '18 at 18:52













0












0








0







I am trying to make a textbox that extracts a word into a keyword in chrome. When i press a button the keyword in the textbox gets implemented into chrome and if that keyword is found, it then goes into that hyperlink.



The code is so far:



from tkinter import *
from tkinter.messagebox import *
import webbrowser

root = Tk()

url = 'https://shop.palaceskateboards.com/'

frame = Frame(root)
frame.pack()

def OpenUrl():
webbrowser.open_new(url)

button = Button(frame, text="Start", command=OpenUrl)

button.pack()

root.mainloop()









share|improve this question















I am trying to make a textbox that extracts a word into a keyword in chrome. When i press a button the keyword in the textbox gets implemented into chrome and if that keyword is found, it then goes into that hyperlink.



The code is so far:



from tkinter import *
from tkinter.messagebox import *
import webbrowser

root = Tk()

url = 'https://shop.palaceskateboards.com/'

frame = Frame(root)
frame.pack()

def OpenUrl():
webbrowser.open_new(url)

button = Button(frame, text="Start", command=OpenUrl)

button.pack()

root.mainloop()






python python-3.x tkinter python-webbrowser






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 '18 at 0:49









Alex_P

193114




193114










asked Nov 11 '18 at 15:08









Hugo Sigurdson

13




13











  • Please provide more information. What do you mean by 'extracts a word into a keyword in chrome'? Which hyperlink are you talking about? Where does the word come from? Do you already tried some code? If so, please add it to your question.
    – Alex_P
    Nov 11 '18 at 15:12











  • I have made a textbox that i can write in, and i have a button. When i press the button, i want the text in the textbox to be implemented into chrome as a keyword. I am trying to make a bot for shop.palaceskateboards.com, written in python. And i want a keyword function that searches for a specific clothing piece.
    – Hugo Sigurdson
    Nov 11 '18 at 15:14







  • 2




    @HugoSigurdson when adding detail to your question, add it to the body of the question; comments aren't the correct place, and comments are much more limited in length and formatting
    – landru27
    Nov 11 '18 at 18:52
















  • Please provide more information. What do you mean by 'extracts a word into a keyword in chrome'? Which hyperlink are you talking about? Where does the word come from? Do you already tried some code? If so, please add it to your question.
    – Alex_P
    Nov 11 '18 at 15:12











  • I have made a textbox that i can write in, and i have a button. When i press the button, i want the text in the textbox to be implemented into chrome as a keyword. I am trying to make a bot for shop.palaceskateboards.com, written in python. And i want a keyword function that searches for a specific clothing piece.
    – Hugo Sigurdson
    Nov 11 '18 at 15:14







  • 2




    @HugoSigurdson when adding detail to your question, add it to the body of the question; comments aren't the correct place, and comments are much more limited in length and formatting
    – landru27
    Nov 11 '18 at 18:52















Please provide more information. What do you mean by 'extracts a word into a keyword in chrome'? Which hyperlink are you talking about? Where does the word come from? Do you already tried some code? If so, please add it to your question.
– Alex_P
Nov 11 '18 at 15:12





Please provide more information. What do you mean by 'extracts a word into a keyword in chrome'? Which hyperlink are you talking about? Where does the word come from? Do you already tried some code? If so, please add it to your question.
– Alex_P
Nov 11 '18 at 15:12













I have made a textbox that i can write in, and i have a button. When i press the button, i want the text in the textbox to be implemented into chrome as a keyword. I am trying to make a bot for shop.palaceskateboards.com, written in python. And i want a keyword function that searches for a specific clothing piece.
– Hugo Sigurdson
Nov 11 '18 at 15:14





I have made a textbox that i can write in, and i have a button. When i press the button, i want the text in the textbox to be implemented into chrome as a keyword. I am trying to make a bot for shop.palaceskateboards.com, written in python. And i want a keyword function that searches for a specific clothing piece.
– Hugo Sigurdson
Nov 11 '18 at 15:14





2




2




@HugoSigurdson when adding detail to your question, add it to the body of the question; comments aren't the correct place, and comments are much more limited in length and formatting
– landru27
Nov 11 '18 at 18:52




@HugoSigurdson when adding detail to your question, add it to the body of the question; comments aren't the correct place, and comments are much more limited in length and formatting
– landru27
Nov 11 '18 at 18:52












1 Answer
1






active

oldest

votes


















0














Try this code.
For me it works when I entered 'python'.



from tkinter import *
import webbrowser

def google(event):

address = "http://www.google.com/#q="
word = input("What do you want to search for? ")
search = address + word
webbrowser.open_new(search)


root = Tk()
textbox = Entry(root)
button = Button(root, text="Click")
button.bind("<Button-1>", google)
textbox.pack()
button.pack()
root.mainloop()


For the next time, please provide your code even if it is only the creation of your tkinter widgets.



***** Edit *****



For html searching, try to use the following code:



def checkForWord():
r = requests.get("http://example.com/somepage.html")
return "myWord" in r.text


If the html lookup works, incorporate both parts and replace the word variable with the checkForWord function.






share|improve this answer






















  • It crashes for me everytime i try and write something. And it does not search for a specific word in an html webpage.
    – Hugo Sigurdson
    Nov 11 '18 at 15:44










  • This is what i have written, pastebin.com/ebZxMGAk. Some of it is in Swedish.
    – Hugo Sigurdson
    Nov 11 '18 at 15:50











  • No, it does not search for a word on a website. It takes a word you enter in your editor and searches the word in google. Did you try my code and it crashes for you?
    – Alex_P
    Nov 11 '18 at 15:51











  • But i want a textbox that searches for a specific word on shop.palaceskateboards.com, then enters that link containing that word.
    – Hugo Sigurdson
    Nov 11 '18 at 15:52










  • Please see my edit. Maybe that helps.
    – Alex_P
    Nov 11 '18 at 16:03










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53250053%2fhow-can-i-search-an-html-website-for-a-keyword-and-paste-that-link-in-the-search%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Try this code.
For me it works when I entered 'python'.



from tkinter import *
import webbrowser

def google(event):

address = "http://www.google.com/#q="
word = input("What do you want to search for? ")
search = address + word
webbrowser.open_new(search)


root = Tk()
textbox = Entry(root)
button = Button(root, text="Click")
button.bind("<Button-1>", google)
textbox.pack()
button.pack()
root.mainloop()


For the next time, please provide your code even if it is only the creation of your tkinter widgets.



***** Edit *****



For html searching, try to use the following code:



def checkForWord():
r = requests.get("http://example.com/somepage.html")
return "myWord" in r.text


If the html lookup works, incorporate both parts and replace the word variable with the checkForWord function.






share|improve this answer






















  • It crashes for me everytime i try and write something. And it does not search for a specific word in an html webpage.
    – Hugo Sigurdson
    Nov 11 '18 at 15:44










  • This is what i have written, pastebin.com/ebZxMGAk. Some of it is in Swedish.
    – Hugo Sigurdson
    Nov 11 '18 at 15:50











  • No, it does not search for a word on a website. It takes a word you enter in your editor and searches the word in google. Did you try my code and it crashes for you?
    – Alex_P
    Nov 11 '18 at 15:51











  • But i want a textbox that searches for a specific word on shop.palaceskateboards.com, then enters that link containing that word.
    – Hugo Sigurdson
    Nov 11 '18 at 15:52










  • Please see my edit. Maybe that helps.
    – Alex_P
    Nov 11 '18 at 16:03















0














Try this code.
For me it works when I entered 'python'.



from tkinter import *
import webbrowser

def google(event):

address = "http://www.google.com/#q="
word = input("What do you want to search for? ")
search = address + word
webbrowser.open_new(search)


root = Tk()
textbox = Entry(root)
button = Button(root, text="Click")
button.bind("<Button-1>", google)
textbox.pack()
button.pack()
root.mainloop()


For the next time, please provide your code even if it is only the creation of your tkinter widgets.



***** Edit *****



For html searching, try to use the following code:



def checkForWord():
r = requests.get("http://example.com/somepage.html")
return "myWord" in r.text


If the html lookup works, incorporate both parts and replace the word variable with the checkForWord function.






share|improve this answer






















  • It crashes for me everytime i try and write something. And it does not search for a specific word in an html webpage.
    – Hugo Sigurdson
    Nov 11 '18 at 15:44










  • This is what i have written, pastebin.com/ebZxMGAk. Some of it is in Swedish.
    – Hugo Sigurdson
    Nov 11 '18 at 15:50











  • No, it does not search for a word on a website. It takes a word you enter in your editor and searches the word in google. Did you try my code and it crashes for you?
    – Alex_P
    Nov 11 '18 at 15:51











  • But i want a textbox that searches for a specific word on shop.palaceskateboards.com, then enters that link containing that word.
    – Hugo Sigurdson
    Nov 11 '18 at 15:52










  • Please see my edit. Maybe that helps.
    – Alex_P
    Nov 11 '18 at 16:03













0












0








0






Try this code.
For me it works when I entered 'python'.



from tkinter import *
import webbrowser

def google(event):

address = "http://www.google.com/#q="
word = input("What do you want to search for? ")
search = address + word
webbrowser.open_new(search)


root = Tk()
textbox = Entry(root)
button = Button(root, text="Click")
button.bind("<Button-1>", google)
textbox.pack()
button.pack()
root.mainloop()


For the next time, please provide your code even if it is only the creation of your tkinter widgets.



***** Edit *****



For html searching, try to use the following code:



def checkForWord():
r = requests.get("http://example.com/somepage.html")
return "myWord" in r.text


If the html lookup works, incorporate both parts and replace the word variable with the checkForWord function.






share|improve this answer














Try this code.
For me it works when I entered 'python'.



from tkinter import *
import webbrowser

def google(event):

address = "http://www.google.com/#q="
word = input("What do you want to search for? ")
search = address + word
webbrowser.open_new(search)


root = Tk()
textbox = Entry(root)
button = Button(root, text="Click")
button.bind("<Button-1>", google)
textbox.pack()
button.pack()
root.mainloop()


For the next time, please provide your code even if it is only the creation of your tkinter widgets.



***** Edit *****



For html searching, try to use the following code:



def checkForWord():
r = requests.get("http://example.com/somepage.html")
return "myWord" in r.text


If the html lookup works, incorporate both parts and replace the word variable with the checkForWord function.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 11 '18 at 16:00

























answered Nov 11 '18 at 15:39









Alex_P

193114




193114











  • It crashes for me everytime i try and write something. And it does not search for a specific word in an html webpage.
    – Hugo Sigurdson
    Nov 11 '18 at 15:44










  • This is what i have written, pastebin.com/ebZxMGAk. Some of it is in Swedish.
    – Hugo Sigurdson
    Nov 11 '18 at 15:50











  • No, it does not search for a word on a website. It takes a word you enter in your editor and searches the word in google. Did you try my code and it crashes for you?
    – Alex_P
    Nov 11 '18 at 15:51











  • But i want a textbox that searches for a specific word on shop.palaceskateboards.com, then enters that link containing that word.
    – Hugo Sigurdson
    Nov 11 '18 at 15:52










  • Please see my edit. Maybe that helps.
    – Alex_P
    Nov 11 '18 at 16:03
















  • It crashes for me everytime i try and write something. And it does not search for a specific word in an html webpage.
    – Hugo Sigurdson
    Nov 11 '18 at 15:44










  • This is what i have written, pastebin.com/ebZxMGAk. Some of it is in Swedish.
    – Hugo Sigurdson
    Nov 11 '18 at 15:50











  • No, it does not search for a word on a website. It takes a word you enter in your editor and searches the word in google. Did you try my code and it crashes for you?
    – Alex_P
    Nov 11 '18 at 15:51











  • But i want a textbox that searches for a specific word on shop.palaceskateboards.com, then enters that link containing that word.
    – Hugo Sigurdson
    Nov 11 '18 at 15:52










  • Please see my edit. Maybe that helps.
    – Alex_P
    Nov 11 '18 at 16:03















It crashes for me everytime i try and write something. And it does not search for a specific word in an html webpage.
– Hugo Sigurdson
Nov 11 '18 at 15:44




It crashes for me everytime i try and write something. And it does not search for a specific word in an html webpage.
– Hugo Sigurdson
Nov 11 '18 at 15:44












This is what i have written, pastebin.com/ebZxMGAk. Some of it is in Swedish.
– Hugo Sigurdson
Nov 11 '18 at 15:50





This is what i have written, pastebin.com/ebZxMGAk. Some of it is in Swedish.
– Hugo Sigurdson
Nov 11 '18 at 15:50













No, it does not search for a word on a website. It takes a word you enter in your editor and searches the word in google. Did you try my code and it crashes for you?
– Alex_P
Nov 11 '18 at 15:51





No, it does not search for a word on a website. It takes a word you enter in your editor and searches the word in google. Did you try my code and it crashes for you?
– Alex_P
Nov 11 '18 at 15:51













But i want a textbox that searches for a specific word on shop.palaceskateboards.com, then enters that link containing that word.
– Hugo Sigurdson
Nov 11 '18 at 15:52




But i want a textbox that searches for a specific word on shop.palaceskateboards.com, then enters that link containing that word.
– Hugo Sigurdson
Nov 11 '18 at 15:52












Please see my edit. Maybe that helps.
– Alex_P
Nov 11 '18 at 16:03




Please see my edit. Maybe that helps.
– Alex_P
Nov 11 '18 at 16:03

















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53250053%2fhow-can-i-search-an-html-website-for-a-keyword-and-paste-that-link-in-the-search%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

Syphilis

Darth Vader #20