Comments (7)
Thanks for your help Ken! Will be testing this out now and update if there are any further issues.
from rpa-python.
For my case, I found that the function snap() requires the full XPath. Tried the method of finding the exact location of my intended img src using XPath selector. The element_identifier I used is an XPath written in the form of id/name/class, and this worked for me!
from rpa-python.
Hi @brandybaby thanks for raising this!
The expected behaviour should be taking screenshot of the web element only and not the whole webpage. After checking, this looks like a bug in the upstream project TagUI. I'll raise an issue there and follow-up. It could be due to change in Chrome browser behaviour in newer versions or some other reasons. Which causes the screenshot to be entire webpage instead of only the element.
Minimum replication case - below works in TagUI normal mode but does not work in live mode.
https://google.com
snap //*[@name="q"] to q.png
from rpa-python.
Fix implemented upstream, try doing t.setup() and see if it now works for you.
from rpa-python.
Made a commit with below comments. pip install tagui --upgrade
or new installations should now work. Commit will autosync delta files for new releases of TagUI for Python, even if there is an existing installation. Prior to this, users need to do t.setup() to force re-installation of TagUI.
#6 - on macOS with Python 3, there is no SSL certs support by default. adding an additional check to auto-install SSL certs. before this change, download() simply fails.
#7 - adding capability to autosync tagui delta files when new tagui for python releases are installed. this lets users immediately access current features when they do a pip install tagui --upgrade. before this change, t.setup() is needed for existing installations.
#7 - upstream fix implemented for snapshots of web elements on Chrome. fix improves performance and quality base on newer DevTools Protocol capabilities. the fix is accessible when users do a pip install tagui --upgrade. before this change, snap() captures screenshot of the whole webpage instead of only the element.
from rpa-python.
Adding an observation that Chrome taking snapshots in this new way (capturing clipped region vs whole page and clip) momentarily show just the clipped area on the webpage, and showing blank on rest of page. After snapshot is done, it shows back the full webpage. This behaviour is a little unexpected.
Would think either not blanking rest of page, or blanking rest of page while retaining the clipped region, instead of bringing to top left of window. Looking forward to more data points from other users and perhaps other developers on this Chrome behaviour.
from rpa-python.
Thanks for updating back here that it works now!
Yes while the tool supports below as identifiers, XPath is my personal recommended method because it is very expressive (including using and / or) and can do what CSS selectors cannot.
For web automation, web element identifier can be XPath selector, CSS selector or the following attributes - id, name, class, title, aria-label, text(), href (in decreasing order of priority)
Usually I pick an explicit XPath so that my script can fail fast, rather than assuming that everything is fine and working, and caught by surprise later that something broken gone undetected.
from rpa-python.
Related Issues (20)
- After python is packaged as an exe, an error occurs - try using .bat .cmd or shell script HOT 1
- Using reCAPTCHA keys to bypass - those are for the actual website owner for testing HOT 5
- Text not found - r.click() with OCR text by using "Text I want to click on.png" syntax HOT 7
- Out of memory problem - Chrome browser is memory hog, can explore that angle HOT 6
- Linux环境下运行 - pending replication details (maybe can't connect to Chrome) HOT 11
- Will there be support for automation of desktop apps - already, visual automation HOT 2
- snap() captures whole page instead of element - can't replicate in Mac/Ubuntu HOT 8
- Correct estimation of the operation execution time HOT 2
- The problem with Cyrillic in r.keyboard()
- "Speeding up" the search for objects on the screen. HOT 2
- During visual automation, when Chrome pops up, it blocks the program on the desktop
- frame() does not work properly when crossing domain
- use document for context
- dom() returns empty string
- Run rpa in centos error. Setting headless_mode=True, i have no response; When i setting headless_mode=False return error
- r.init() hang on cloned virtual machine
- How to use edge web browser
- r.url("https://www.baidu.com") HOT 1
- 运行可以打开浏览器,但是浏览器显示崩溃
- The code ran successfully but the mouse did not respond
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rpa-python.