Reputation: 121
My python script simply opens up google.
Batch Code ::
@py.exe "C:\Users\Hey\Desktop\C.Outlet\Computer Science\Python\TryingToScrape.py"
pause
Python Code::
#! python 3.7
#Web Scraping
import webbrowser
webbrowser.open('www.google.com/')
I can't get it to work, and I this is my end result
C:\Users\Hey\AppData\Local\Programs\Python\Python37-32\python.exe: can't open file '3.7': [Errno 2] No such file or directory
C:\Users\Hey>pause
Press any key to continue . . .
Works in IDLE, not through cmd I guess? Need that overflow insight
Upvotes: 0
Views: 28
Reputation: 2660
It's the line (shebang) #! python 3.7
in your code. I've reproduced the error, and removing it lets the code run fine.
Original:
#! python 3.7
#Web Scraping
import webbrowser
webbrowser.open('www.google.com/')
Working (tested):
#Web Scraping
import webbrowser
webbrowser.open('www.google.com/')
Upvotes: 2