5

I've built a web scraper using Selenium that I need to run when my local machine is sleeping and not connected to a network. I have a remote server that I can use to run this script, but I'm having a hard job conceptualizing how this will work. Can I use Selenium's remote driver to do this? I have it installed on my local, do I need to install anything on my server?

Here's an example of the start of my script which runs great on my local:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from twilio.rest import TwilioRestClient
import sys
# driver = webdriver.Chrome()
driver = webdriver.Remote(
command_executor='http://127.0.0.1:4444/wd/hub',
desired_capabilities=DesiredCapabilities.CHROME)

driver.get("http://www.southwest.com")
Artjom B.
  • 61,146
  • 24
  • 125
  • 222
Ryan
  • 63
  • 2
  • 5

1 Answers1

-1

Does your code resides on remote server? Do you want to execute tests on remote server or local machine? Where is your node?

keep your code on remote server -> make it(remote) hub -> register node of your choce where you want to execute test cases -> create a jenkins job for this which will enable to execute on demand.

JavaPhySel
  • 81
  • 8