Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headless mode cannot find element error? - bug with newer Chrome versions [fixed] #216

Closed
prashanttrivedi47 opened this issue Mar 1, 2021 · 6 comments
Labels

Comments

@prashanttrivedi47
Copy link

Script running in alpine image docker container
running in chromium headless mode

can not find a xpath -
eg 1. r.type('/html/body/div[1]/div[1]/div[2]/div/div[2]/div/div/div[2]/div/div[1]/div/form/span/section/div/div/div[1]/div/div[1]/div/div[1]/input', '[email protected]'))
eg 2.
r.type('//*[@id="identifierId"]', '[email protected]')

=> this return a False and error
=>r.init() and r.url('https://www.google.com') returns True

[RPA][ERROR] - cannot find /html/body/div[1]/div[1]/div[2]/div/div[2]/div/div/div[2]/div/div[1]/div/form/span/section/div/div/div[1]/div/div[1]/div/div[1]/input

Can you please tell me that why r.type() is returning a error ?

Note: script running normally in ubuntu but not in container docker

@Dka233
Copy link

Dka233 commented Mar 4, 2021

I don't think this is the better way to find the place in website to write your '[email protected]'. For example, if you want to write something in the comment box in GitHub you should write:

r.type('//*[@id="new_comment_field"]', '[email protected]') as you write in your eg2.

If you are getting an error maybe it is because your form is inside of an iframe, I had this kind of problem.

Regards.

@prashanttrivedi47
Copy link
Author

I don't think this is the better way to find the place in website to write your '[email protected]'. For example, if you want to write something in the comment box in GitHub you should write:

r.type('//*[@id="new_comment_field"]', '[email protected]') as you write in your eg2.

If you are getting an error maybe it is because your form is inside of an iframe, I had this kind of problem.

Regards.

I have run in local ubuntu It is running fine but problem in alpine docker container
I was try to run in headless mode but r.type() return an error as you seen above, I think chromium issue is their
may be some driver issue till now I am unable to find ...

@fi-do
Copy link
Contributor

fi-do commented Mar 10, 2021

Hey @prashanttrivedi47,
can you give the following hack a try?

Hope it will help you,
fi-do

@prashanttrivedi47
Copy link
Author

Hey @prashanttrivedi47,
can you give the following hack a try?

Hope it will help you,
fi-do

I have already tried , I have changed from chrome to headless but didn't work

@kensoh
Copy link
Member

kensoh commented Apr 2, 2021

Thanks @prashanttrivedi47 for raising this! The package is not designed to run headless mode, but this should be fixed.

I believe this is likely due to a bug in newer Chrome version. When it runs in headless mode, one of the parameters used can no longer support calling a relative directory but the absolute directory to the TagUI Chrome user profile is now required.

More details on the issue - aisingapore/TagUI#890

Can you try make the following changes to your tagui file to see if that works. In a future release this will be fixed.

aisingapore/TagUI@3da665f

The tagui file that you want to modify is ~/.tagui/src/tagui (where ~ is your user home directory)

@kensoh kensoh changed the title why r.type() is returning a error ? Headless mode returning cannot find error? - potential bug with newer Chrome, see this fix Apr 2, 2021
@kensoh kensoh changed the title Headless mode returning cannot find error? - potential bug with newer Chrome, see this fix Headless mode cannot find error? - potential bug with newer Chrome, see this fix Apr 2, 2021
@kensoh kensoh added the bug label Apr 2, 2021
@kensoh kensoh changed the title Headless mode cannot find error? - potential bug with newer Chrome, see this fix Headless mode cannot find error? - bug with newer Chrome, see this fix for now Apr 2, 2021
@kensoh kensoh changed the title Headless mode cannot find error? - bug with newer Chrome, see this fix for now Headless mode cannot find error? - bug with newer Chrome, see this solution for now Apr 2, 2021
@kensoh
Copy link
Member

kensoh commented Apr 6, 2021

This is fixed in v1.31, available with pip install rpa --upgrade

@kensoh kensoh changed the title Headless mode cannot find error? - bug with newer Chrome, see this solution for now Headless mode cannot find error? - bug with newer Chrome versions [fixed] Apr 6, 2021
@kensoh kensoh changed the title Headless mode cannot find error? - bug with newer Chrome versions [fixed] Headless mode cannot find elementerror? - bug with newer Chrome versions [fixed] Apr 6, 2021
@kensoh kensoh changed the title Headless mode cannot find elementerror? - bug with newer Chrome versions [fixed] Headless mode cannot find element error? - bug with newer Chrome versions [fixed] Apr 6, 2021
@kensoh kensoh closed this as completed Apr 28, 2021
@kensoh kensoh reopened this Apr 28, 2021
@kensoh kensoh closed this as completed May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants