-
Notifications
You must be signed in to change notification settings - Fork 2
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
Selenir session object created - no browser open #28
Comments
What happens when you run {RSelenium} is pretty buggy, and in this case the creation of the selenium client and server is handled by it, so the issue is likely there. You might be better off using {selenium}, a more up-to-date alternative.
|
Dear @ashbythorpe , Thank you very much for your quick reply! Indeed, the reason for me to still use {Rselenium} was because I had been using it but it bugged recently. I wanted to see if it worked with selenider. Trying I would like to switch to {selenium}: When doing the test, it gives TRUE:
however, when I try the code you stated, this happens, please see the printscreen below:
with more details here: Would you have an idea why the selenium session does not open? I have added the Chrome.exe in my PATH variable fully at the end by adding this to the existent PATH: ";C:\Program Files\Google\Chrome\Application\chrome.exe" --> or should it be the folder of the chrome.exe and not the .exe itself? Regards, |
Can you try running this code: library(selenium)
server <- selenium_server(interactive = FALSE)
wait_for_selenium_available(error = TRUE) If this fails (which it should), run: server$read_output()
server$read_error() The output should help diagnose the selenium problem. I've also remembered that RSelenium doesn't work with the latest version of Chrome (ropensci/wdman#34), so it may work if you use a different browser or older Chrome version. |
Thanks again! Running these 3 lines, gives indeed an error:
Then running the 2 last lines:
gives this output: This is the JAVA version on my laptop: Does this error message mean that the JAVA installation on my desktop needs to be updated to a more recent version? |
Yes, you need at least Java 11 to run Selenium (https://www.selenium.dev/blog/2023/java-8-support/). You can download an up-to-date version of Java here: https://www.oracle.com/java/technologies/downloads/ I'm going to try to fix the error messages in selenium so you always see the output of |
Dear @ashbythorpe , thank you very much for all your help on this. As i am on a corporate laptop, I will ask our IT desk whether it is possible to download a version 11 or higher of Java. For information, I also tried reverting back to previous chromedriver.exe for {Rselenium} but it didn't work neither. Could it be that thatis also related to the Java version? |
Hi @ashbythorpe , in the mean time Java 11 was installed: When trying to run the following 5 lines:
this error message and accompanying server output come up: With more details on the error: Do you have an idea what this related to? |
Actually this evening, I tried again, the 5 lines of codes and this was the message:
Could there be something related to the Selenium version (from the printscreen it looks like version: 4.24.0) I am using, related to the Chrome browser (version: 128.0.6613.86)? |
Hi, so I've pushed an update to selenium that can handle non-JSON errors. Install it using As for the RSelenium issue, using Chrome is weird because the version of Chrome, the browser itself, and chromedriver have to match. So in order to use RSelenium, you have to use both a prior version of chromedriver and a prior version of Chrome itself (which can be pretty hard to get). I'd strongly recommend using a different browser if you plan on using RSelenium. |
Hi @ashbythorpe , thanks again for this. Running the code to download: Then running the 5 lines of codes as previously done:
Do you have an idea of what this could be about? |
It looks like the installation failed because you don't have the tools to compile packages from source. Try downloading the package from r-universe: Then try the other commands again. |
Oh, well it looks like the newest version of selenium is working. Try running your original code with selenider again. |
Dear @ashbythorpe , thank you very much, it worked!! Chrome browser opened up: What was the issue in the end? Was it the Java version on my computer? |
I'm not actually sure to be honest, since we didn't actually get to see what the error was. It seems that updating selenium fixed it, but I'm going to keep this issue open for a little bit in case it happens again. |
Hi @ashbythorpe , I just wanted to let you know that I have been using selenider since our last communication and it works great! Very smoothly. Thank you very much for all your help again. |
Hi @ashbythorpe , hope you're fine! I have one other question about the use of selenider: sometimes in RStudio, when trying to open a Seleniucm by this code:
Then I don't know anything else to do then close RStudio and re-opening and it works. Is there any code that you would recommend to do this instead of closing and re-opening RStudio? Regards, |
I haven't encountered this issue before. Next time you encounter it, could you see what Also, I would imagine that restarting R (in RStudio, Session -> Restart R) will be quicker than closing and re-opening RStudio itself. |
Dear All,
Sorry for my non-knowledge on this.
I ran the following scripts:
selenider_available(session = "rselenium", online = TRUE)
answer = TRUE
session <- selenider_session("rselenium", browser = "chrome", timeout = 4, driver = RSelenium::remoteDriver(port = 4567L, browserName = "chrome"))
A .cmd printscreen comes up (and closes automatically) stating the version of Chrome on my local machine.
Then a selenider session object seems open:
But I do not see a Chrome browser opening up.
When I try to use the code open_url(), this is the message that comes up:
Do you see what I am doing wrong?
Regards,
Marnix
The text was updated successfully, but these errors were encountered: