tebelorg / RPA-Python

Python package for doing RPA
Apache License 2.0
4.97k stars 670 forks source link

Add chrome.exe secondary location for Windows - upstream change [done] #103

Closed juniorkidsu closed 4 years ago

juniorkidsu commented 4 years ago

import rpa as r r.init() r.url('https://ca.yahoo.com') r.type('search-box', 'github')

search_text = r.read('search-box') print(search_text)

r.click('search-button') r.wait(6.6)

r.snap('page', 'results.png') r.snap('logo', 'logo.png')

r.url('https://duckduckgo.com') r.type('search_form_input_homepage', 'The search engine that doesn\'t track you.') r.snap('page', 'duckduckgo.png') r.wait(4.4)

r.close()

THIS IS SAMPLE CODE FROM RPA library but on got some error like this image

What can i fix this case?? because i declare init() before using url()

kensoh commented 4 years ago

It looks like TagUI can't be started on your laptop. It could be due to different reasons -

Can you provide more information such as OS (Windows, macOS, Linux) and your user name for the OS? On Windows, there is problem with user name having space in it, and if the folder you are running automation has a space in the pathname.

Another common cause is some companies have network restriction to prevent downloading automatically from the GitHub URLs. Depending on your OS the location to check is different. For Windows it is in the %APPDATA%\tagui folder.

If you are running macOS, check that it is not due to Catalina blocking TagUI from running -

🍎 macOS - Catalina update introduces tighter app security, see solutions for PhantomJS and Java popups

juniorkidsu commented 4 years ago

My OS platform is Windonw10 1809

In another case i checking in tagui folder. There completely all of file or you want me to some important file/folder?

kensoh commented 4 years ago

Try this - Open command prompt

cd %appdata% cd tagui cd src tagui samples/1_yahoo chrome

Then tell me what error you have

juniorkidsu commented 4 years ago

Ok i found this! image

kensoh commented 4 years ago

This is strange, this error message should appear when you do r.init() to tell user what is the issue.

The message is because Chrome application is not found on your computer at the folder which is commonly installed on Windows for Chrome. Make sure you have Chrome browser installed.

If you already have Chrome installed but it is not in above location, edit %appdata%\tagui\src\tagui.cmd and change the chrome_command setting to the location of your chrome.exe. Note that if you modify it, after you pip install rpa --upgrade this modification will be lost. Also, let me know your chrome.exe location. This will be useful info to see if TagUI can be improved to recognise other locations.

juniorkidsu commented 4 years ago

OK this here is my Chrome location C:\Users\MyUsername\AppData\Local\Google\Chrome\Application

How can i edit in tagui.cmd when i open,there already early close

kensoh commented 4 years ago

Thanks, I see.. You can use Notepad editor and open the file tagui.cmd, after that you can modify at top of the file the following to the correct Chrome browser location on your computer -

rem configure command to launch chrome for Windows
set chrome_command=C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
juniorkidsu commented 4 years ago

Ok this time i change application i found this Alert! when i run tagui sample/...

Fatal: The system cannot find the file specified; did you install phantomjs? ?? it's callme to install phantomjs or i will recheck this folder

juniorkidsu commented 4 years ago

Nicee after i copy phantomjs folder it's working!! both of cmd and python Script Thank you so much for advice XD @kensoh everything working well

kensoh commented 4 years ago

That's great, thanks for your update @juniorkidsu !

The PhantomJS is likely due to firewall or anti-virus restriction which may block PhantomJS from being download and extracted to the folder. Glad that you have resolved it, have fun using it!

kensoh commented 4 years ago

Upstream TagUI change, implemented in v1.25, available with pip install rpa --upgrade

Some Windows users may not install Chrome to C:\Program Files... folder due to no access rights to install Chrome system wide (default behaviour) or did not approve the user access control to install there. Added a secondary location that is hosted in %LOCALAPPDATA%... folder so those minority group of users don't have to manually edit the tagui.cmd file to point to that location.