Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

I was trying to write a Python script to move the cursor to delete browser history, but when it exits vscode the script stops. Is there a fix?

$
0
0
from pynput.mouse import Button,Controllerimport webbrowserimport timemouse=Controller()url = 'google.com'chrome_path = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'mouse.position = (1500, 55)mouse.press(Button.left)mouse.release(Button.left)mouse.position = (1400, 270)mouse.press(Button.left)mouse.release(Button.left)#has now exited vscode and stopped runningmouse.position(1000,100)mouse.press(Button.left)mouse.release(Button.left)#webbrowser.get(chrome_path).open(url)

I initially thought it was not working because it was attempting to run all the cursor movements simultaneously, but it did not appear to be that, and exiting vscode seemed like the only possible issue.


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>