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

Adding Profile Setting to RSelenium Firefox #289

Open
Vanderser opened this issue May 2, 2024 · 0 comments
Open

Adding Profile Setting to RSelenium Firefox #289

Vanderser opened this issue May 2, 2024 · 0 comments

Comments

@Vanderser
Copy link

Vanderser commented May 2, 2024

I am using Windows 7, I have both chrome webdriver version 108.0.5359.71 and geckodriver with version 0.34.0, and also installed mozilla firefox browser with version 115, In this case I am trying to reach web.whatsapp.com by both chrome and firefox for comparisons.

With chrome, I actually can surf the whatsapp web (automatically bypass the qr-code), with these settings:

user_agent <- "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.5359.71 Safari/537.36"
language <- "en-US,en;q=0.5"
accept_language <- "en-US,en;q=0.9"
platform <- "Windows NT 6.1; Win64; x64"
chrome_user_data_dir <- "C:\\Users\\User\\AppData\\Local\\Google\\Chrome\\User Data"
firefox_user_data_dir <- "C:\\Users\\User\\AppData\\Local\\Mozilla\\Firefox\\Profiles"

options <- list(
      chromeOptions = list(
        args = c(
          paste0("--user-agent=", user_info$user_agent),
          paste0("--lang=", user_info$language),
          paste0("--user-data-dir=",chrome_user_data_dir)
        )
      )
    )

rD <- rsDriver(browser="firefox", port = 4567L, chromever = NULL, verbose=F, 
               extraCapabilities = options)
remDr <- rD[["client"]]
remDr$navigate("https://web.whatsapp.com/")

However I need to access the whatsapp web using firefox since the chrome browser has known issues/limitation of videos playback element for whatsapp web, which I need to load in my project. These are my current settings for the firefox RSelenium setup:

firefox_profile_template <- list(
    browserName = "firefox",
    "moz:firefoxOptions" = list(
      prefs = list("intl.accept_languages" = language),
      args = list(paste0("--user-agent=", user_agent), paste0("--user-data-dir=", user_data_dir))
    )
  )
)
    
rD <- rsDriver(browser="firefox", port = 4567L, chromever = NULL, verbose=F, 
               extraCapabilities = firefox_profile_template)
remDr <- rD[["client"]]
remDr$navigate("https://web.whatsapp.com/")

And unfortunately these settings still make it stuck at whatsapp qr-code everytime the code run. I dont have any clue to solve this since its my first experience to attach user profile to firefox.

These are Note with pictures before navigate to web.whatsapp.com:

Actual Firefox Browser:

1

RSelenium firefox launch:

2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant