-
Notifications
You must be signed in to change notification settings - Fork 598
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
1_google.tag fails to find element q - try this, google.com different for diff locations #944
Comments
Hello @42Network This sample flow should work on macOS too. I just tried running it on my macbook and it works. Both name (q) and class (.gLFyf.gsfi) attributes should work. The chrome TagUI plugin just returns one of the many identifier which TagUI tries to detect. FYI, TagUI auto-selects provided identifier in this order - xpath, css, id, name, class, title, aria-label, text(), href. I am suspecting the search results might have taken a while to return, perhaps due to a lag in network connectivity at that particular moment. Hence TagUI was unable to find the search results (cannot find (//*[@Class="g"])[1]//a). You may also want to check if your chrome browser is up to date - if there's a pending update it should show on the top right corner of the browser with the word "Update". |
(oops, after posting then I saw Ruth's message, I didn't refresh the issue page from earlier) Hi Nathan, thanks for raising this issue! Adding on, the example is also working on my computer. This is because google.com renders differently base on user's location. TagUI smart identifier search actually checks through a few things for the best match. The exact order is More reference - https://github.com/kelaberetiv/TagUI/tree/pre_v6#steps-description And it not just checks for an exact match, it checks if an element contains the string you provide too. For eg if you provide Please try the following to see if it works on your computer. If it works, it's because there must be some other element with css, id or name that contains the string 'q' and it got matched before that element. Using below ensures that you are clicking on the element with name attribute "q"
PS - thanks Ruth! |
Hi. Thanks for your suggestions. My Chrome is at the latest version (Version 88.0.4324.192 (Official Build) (x86_64)). And unfortunately, changing the 1_google.tag to use [@name="q"] still didn't help. This doesn't seem to be a performance issue either, because when I try "tagui live" and watch the Chrome window, TagUI never even tries to initiate the search. It just does nothing at all since it cannot seem to find the "q" field. Very baffling. Are there any further troubleshooting steps? Mine is a very simple case. Vanilla TagUI install, using your basic sample, my location is USA. And clearly, based on the page source I posted, the field is still named "q" yet TagUI doesn't find it. FYI I verified that PhantomJS is working with no permission issues and I am using the Amazon OpenJDK, as recommended. I was very hopeful this TagUI package would work for me, but it is disappointing that a simple Google search fails. I'm feeling dumb here.... |
Hi Nathan, thanks for sharing all these details! This is indeed very puzzling. Can you run the script, and after it hangs or completes, drag and drop to attach a copy the log file tagui/src/tagui_chrome.log here, so that we can check what could have gone wrong there. |
Adding on, for us, when we try accessing the Google US page with below URL - type q as 123 doesn't work because the Feeling Lucky button has an attribute containing the 'q' string, but For reference, this is what we see on our tagui_chrome.log when doing type //*[@name="q"] --> matches with 1
|
Here is my latest log file. I think you are right about the "Feeling Lucky" button. I see it blink briefly when the script runs. Thanks for looking into this! |
Here is the log file using the @name="q" query. You can see there is an error saying:
So why would Chrome think that is an invalid selector? |
Something is going very wrong on your computer, notice that in the logs, the identifier includes the type word?
Checking more. |
But my log is just |
The kind of error above I can imagine only happens if somehow the TagUI source code has been modified or accidentally changed, in order to break it that way. In your log file, TagUI is not only sending the identifier over to Chrome, it is also sending the 'type ' string as part of the identifier to search for, so for sure it will break. But I can't think of any reason why your copy is behaving that way and have not seen anything like this situation before being reported. |
Are TagUI and RPA for Python incompatible with each other? Originally I had installed RPA for python with "pip3 install rpa" and that put a bunch of stuff in a hidden .tagui directory. But since I couldn't get RPA for Python working quite right, I tried to uninstall it and then installed plain TagUI to see if it would work by itself, but obviously it isn't. Can you tell me how to make sure both RPA for Python (.tagui) and TagUI are fully removed from macOS, so I can start clean with just TagUI? Thanks |
TagUI and RPA for Python can exist together on the same computer. They each have their own installation directories. RPA for Python is based on a fork of TagUI optimised for the Python package, that's why it maintains its own directory. Yes for Mac it is a .tagui directory. To delete RPA for Python, be very careful, just delete the .tagui directory. And pip3 uninstall rpa To delete TagUI, you delete the tagui folder which you unzip, and remove that folder from your path environment variable. |
We have a weekly live Q&A where we meet users in Zoom breakout rooms to troubleshoot issues 1-to-1. This is the details #914 but I think it is bad timing for Texas (Thursday 2am your time) |
False alarm! I made a mistake in my 1b_google.tag and actually had written
When I removed the superfluous type, it works!
So what is the lesson to be learned here? Your 1_google.tag sample didn't work out of the box but needed to be targeted to look for name=q. How can we catch this kind of gotcha in the future? Can you put a note in the tutorials about this possibility? Now on to my actual use case, which is to automatically download my recent bank transactions on a daily basis. Thanks! |
Thanks Nathan for your feedback! I've updated the Google example in samples. I added an additional line and note as fallback due to difference in google.com for different locations.
|
Thanks for your help kensoh |
Plain vanilla TagUI macOS install, per the instructions. Fails to find anything:
Using Chrome TagUI plugin, I discover the search box is not named as "q" but as ".gLFyf.gsfi":
If I edit 1_google.tag to match the weird name, it works:
What is wrong here? Google page source:
<input class="gLFyf gsfi" maxlength="2048" name="q" type="text" jsaction="paste:puy29d" aria-autocomplete="both" aria-haspopup="false" autocapitalize="off" autocomplete="off" autocorrect="off" autofocus="" role="combobox" spellcheck="false" title="Search" value="" aria-label="Search" data-ved="0ahUKEwjRrJP6zoDvAhUJSa0KHaPmB0IQ39UDCAY">
It appears TagUI only looks for the "input class", and not the name? What am I doing wrong?
Thanks
The text was updated successfully, but these errors were encountered: