tebelorg / RPA-Python

Python package for doing RPA
Apache License 2.0
4.85k stars 663 forks source link

How to activate a page? - some thoughts to explore, or use visual automation #340

Closed rmrao-peruri closed 2 years ago

rmrao-peruri commented 2 years ago

I want to open a page (https://www.nseindia.com/all-reports), click a link [bhavcopy file (csv)] and download the file. Attaching the Jupytr notebook for your reference The downloadNseEodPrice function fails to download the file unless I navigate to the Chrome opened by RPA and click on the page. Surprisingly the call to input is successful though the hello text is not visible on the browser

I am sure I am making some silly mistake. Can you pls help?

nseDownload.txt

kensoh commented 2 years ago

Hi @rmrao-peruri is this still an issue? Could you try copying all the Jupyter notebook code into a .py file and see if it happens? Do also paste the code here and let me try to replicate if it also happens on my computer.

Sounds like it might be the webpage has some logic that only allows download to happen if a user is really focusing on the browser and not through automation. We'll see.. In any case, there are alternative methods like using visual automation which can simulate a real user's actions and should be able to get around that.

kensoh commented 2 years ago

For example, something like r.click('chrome_icon.png') can be used to click on the Chrome icon to bring it to foreground.