Category : python-webbrowser

my simple program is running command from button on start of program instead on button press. I’m not sure if it is something wrong with my environment or code import tkinter as tk import webbrowser window = tk.Tk() url = ‘test.site’ button_ticket= tk.Button(text="Open Test Site") button_ticket.pack(pady=20) button_ticket.bind(webbrowser.open_new(url)) window.mainloop() Source: Python..

Read more

I’m having trouble getting this program to work with different languages. When using English and with the same links I get good results but the second I try to type something in Korean it all changes to ???. import sys import webbrowser search_word = sys.argv[1] sites = [f’https://en.dict.naver.com/#/search?query={search_word}’, f’https://ko.dict.naver.com/#/search?query={search_word}’, f’https://forvo.com/word/{search_word}/#ko’] for site in sites: webbrowser.open(site) ..

Read more

My code is not working i tried so much but i cant spot mistake in code….. import pyautogui import webbrowser as wb import time chrome_path="C:Program FilesGoogleChromeApplicationchrome.exe" wb.register(‘chrome’, None,wb.BackgroundBrowser(chrome_path)) wb.get("chrome").open("web.whatsapp.com") time.sleep(30) for i in range(10): pyautogui.press("i sm spamming you using python") pyautogui.press("enter") Source: Python..

Read more

I’m trying to scrape the HTML code of a new chrome tab, but I can’t find a way that works using Python. Here’s what I’ve tried: I’ve tried the requests module, but this code: import requests URL = "chrome://newtab" page = requests.get(URL) print(page.text) Yields this error: Traceback (most recent call last): File "c:UsersBen BistlineCodePythonFilesPythonFileschromescrape.py", line ..

Read more

I need help with this code: import webbrowser chrome_path = ‘C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s’ webbrowser.get(chrome_path).open(‘https://www.google.com/’) print(‘test browser’) it open chrome and visit the website, but don’t print until I close the browser. If I use this one: import webbrowser webbrowser.open(‘https://www.google.com/’) print(‘test browser’) It run default browser(brave), visit the website and print correctly. How can I ..

Read more