This file contains hidden or 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
see the original post on https://www.binaryclips.com/2016/03/css-selectors-for-selenium-webdriver.html?spref=bl | |
Css Selectors for Selenium WebDriver | |
CSS selectors are a great and fast way to locate elements in Selenium WebDriver. I have listed down some basic CSS Selectors for Selenium WebDriver which are commonly used. The goal of this tutorial is to explain as simply as possible about various types of usages of CSS Selectors using simple examples. | |
Css Selector Using ID Selector | |
Consider the below HTML | |
<input id="userid" type="text" value="userid" /> | |
<button id="btnid">Submit button</button> |
This file contains hidden or 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
var myWindow = window.open(); | |
var imglink = document.querySelectorAll('img'); | |
for (i=0;i<imglink.length;i++){myWindow.document.write("<p><a href=\"" + imglink[i].src + "\" target=\"\_blank\">link</a>");} |
This file contains hidden or 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
{ | |
"AL": "Alabama", | |
"AK": "Alaska", | |
"AS": "American Samoa", | |
"AZ": "Arizona", | |
"AR": "Arkansas", | |
"CA": "California", | |
"CO": "Colorado", | |
"CT": "Connecticut", | |
"DE": "Delaware", |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
from multiprocessing import Pool | |
from multiprocessing.dummy import Pool as ThreadPool | |
import re, os | |
from urllib2 import urlopen | |
Path = os.path.dirname(os.path.realpath(__file__)) | |
with open(Path+'\\url.txt', 'r') as file: | |
urls = file.readlines() |
This file contains hidden or 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
id | query | |
---|---|---|
48843 | this is a sample query | |
3894 | also a sample query | |
9349589 | so on and so forth |
This file contains hidden or 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
/* | |
INSTRUCTIONS | |
1. Open this file in notepad or something similar | |
2. Paste your list of names where it says replace names | |
3. Go to linkedin and line up a people search for your city | |
4. In google chrome. In Windows and Linux hit: Ctrl + Shift + J. On Mac hit: Cmd + Option + J. | |
5. Copy paste this whole script in to the console and hit enter | |
6. leave the window active while it collects results | |
7. You should get a tab seperated CSV that you can open in Excel |
This file contains hidden or 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
(Linkedin = { | |
release: '1.0.5 stable', | |
data: {}, | |
config: { | |
autoStart: true, | |
inspectorSpeed: 5000, | |
sendSpeed: 4000, | |
pagerSpeed: 10000, | |
scrollDownAuto: 600, | |
debug: true, |
This file contains hidden or 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
<style> | |
body { | |
margin: 0; | |
display: grid; | |
height: 100vh; | |
place-items: center; | |
background-color: #000; | |
font-size: 12px; | |
} |
This file contains hidden or 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
but = $$('[data-testid*="-follow"]') | |
//for (i in but) {but[i].click()} | |
for (var i = 0; i < but.length; i++) { | |
let button = but[i] | |
setTimeout(() => { | |
button.click() | |
}, 1000 * i) | |
} |
This file contains hidden or 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
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left) | |
// https://gist.github.com/JamieMason/7580315 | |
// | |
// 1. Go to https://twitter.com/YOUR_USER_NAME/following | |
// 2. Open the Developer Console. (COMMAND+ALT+I on Mac) | |
// 3. Paste this into the Developer Console and run it | |
(() => { | |
const followButtonQuery = '[data-testid$="-unfollow"]'; | |
const confirmButtonQuery = '[data-testid="confirmationSheetConfirm"]'; | |
const sleep = ({ seconds }) => |