Last active
June 12, 2019 00:23
-
-
Save AaronMT/7271240 to your computer and use it in GitHub Desktop.
$> monkeyrunner sites.py sites.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"http://google.com" | |
"http://facebook.com" | |
"http://youtube.com" | |
"http://yahoo.com" | |
"http://baidu.com" | |
"http://wikipedia.org" | |
"http://live.com" | |
"http://qq.com" | |
"http://amazon.com" | |
"http://twitter.com" | |
"http://taobao.com" | |
"http://blogspot.com" | |
"http://linkedin.com" | |
"http://google.co.in" | |
"http://yahoo.co.jp" | |
"http://sina.com.cn" | |
"http://ebay.com" | |
"http://msn.com" | |
"http://google.co.jp" | |
"http://bing.com" | |
"http://yandex.ru" | |
"http://wordpress.com" | |
"http://google.de" | |
"http://google.com.hk" | |
"http://vk.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice | |
import sys, csv | |
browsers = ['org.mozilla.fennec_rnewman/.App'] | |
def main(): | |
# Connects to the current device, returning a MonkeyDevice object | |
device = MonkeyRunner.waitForConnection() | |
#Start each browser activity with the provided URI | |
for run, browser in enumerate(browsers): | |
# Visit each site | |
for visit, site in enumerate(csv.reader(open(sys.argv[1]).readlines())): | |
# Start the activity with the provided site | |
device.startActivity(component=browser, uri=site[0]) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment