Run iphone safari from mac with python + selenium + safari-webdriver

Motivation

I found an article that seems to have officially introduced the safari web driver from iOS 13. (Webdriver is Comming to Safari in iOS13) I couldn't find an article on how to do it at all. So I tried and errored myself, and I was able to move it, so I would like to keep a record.

table of contents

  1. Settings on the iPhone side
  2. Operate from the MAC side

① iPhone settings

--Settings → Safari → Advanced → Turn on remote automation --To connect iPhone to MAC and trust this computer Yes

② Operation from the MAC side

First install selenium pip install selenium

Below is the code in python

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

desiredcapabilities= DesiredCapabilities.SAFARI.copy()
desiredcapabilities["platform"]="ios"

driver = 
webdriver.Safari(desired_capabilities=desiredcapabilities)

driver.get("https://google.co.jp")

You can run safari on iphone from mac

Recommended Posts

Run iphone safari from mac with python + selenium + safari-webdriver
Run Aprili from Python with Orange
Get html from element with Python selenium
Run Python with VBA
Run prepDE.py with python3
Run python from excel
Run Blender with python
ScreenShot with Selenium (Python)
Scraping with Selenium [Python]
Run iperf with python
Run Python from Excel VBA with xlwings & tutorial supplement
Install selenium on Mac and try it with python
Read QR code from image file with Python (Mac)
Run python with PyCharm (Windows)
Scraping with selenium in Python
Scraping with Selenium + Python Part 1
Run Python with CloudFlash (arm926ej-s)
Let's run Excel with Python
Python3 + Django ~ Mac ~ with Apache
Python: Working with Firefox with selenium
Run Label with tkinter [Python]
Scraping with Selenium + Python Part 2
With skype, notify with skype from python!
Run DHT22 with RasPi + Python
Using OpenCV with Python @Mac
Call C from Python with DragonFFI
Using Rstan from Python with PypeR
Scraping with Selenium in Python (Basic)
Install Python from source with Ansible
Create folders from '01' to '12' with python
Run Rotrics DexArm with python API
Run mruby with Python or Blender
Run XGBoost with Cloud Dataflow (Python)
View Mac desktop notifications from Python
Python error detection run from Powershell
Run Python scripts synchronously from C #
Call python from nim with Nimpy
Until you run python with apache
Run Ansible from Python using API
Read fbx from python with cinema4d
Operate Firefox with Selenium from python and save the screen capture
Install python with mac vs code
Call C / C ++ from Python on Mac
Run Python Scripts from Cisco Memorandum_EEM
Update Python on Mac from 2 to 3
Collecting information from Twitter with Python (Twitter API)
[Python] Building an environment with Anaconda [Mac]
Run Cloud Dataflow (Python) from App Engine
Receive textual data from mysql with python
[Note] Get data from PostgreSQL with Python
Run servo with Python on ESP32 (Windows)
Play audio files from Python with interrupts
WebUI test with Python2.6 + Selenium 2.44.0 --profile setting
Run Keras with CNTK backend from CentOS
Tweet from python with Twitter Developer + Tweepy
Follow active applications on Mac with Python
Business efficiency starting from scratch with Python
Decrypt files encrypted with openssl from python with openssl
Working with Azure CosmosDB from Python Part.2
Image acquisition from camera with Python + OpenCV
Build Python environment with Anaconda on Mac