Skip to content

Instantly share code, notes, and snippets.

View yevbar's full-sized avatar

Yev Barkalov yevbar

View GitHub Profile
# import for making requests
import requests
# import for parsing and manipulating the html
from lxml import html
# initialize a session
session_requests = requests.session()
# the login url where we will get the CSRF key
login_url = "https://www.linkedin.com"
# get the login url, which is the linkedin homepage when you aren't logged in
@yevbar
yevbar / index.html
Created March 4, 2018 12:24
How to start a website with HTML
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>
from time import sleep
import requests
from fake_useragent import UserAgent
from stem import Signal
from stem.control import Controller
import random
"""
I found that having the loop run on its own without any sleep() or pauses led to the same ip address over and over again
But, as I was manually typing it out in the terminal (via >>>), it actually changed IPs
from selenium.webdriver import Firefox
from selenium.webdriver.firefox.options import Options
opts = Options()
opts.set_headless()
assert opts.headless # operating in headless mode
browser = Firefox(options=opts)
browser.get('https://duckduckgo.com')
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
#geckodriver = 'C:\\Users\\grayson\\Downloads\\geckodriver.exe'
options = webdriver.FirefoxOptions()
#options.add_argument('-headless')
@yevbar
yevbar / index.html
Created June 11, 2018 22:15
index.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>StuyHacks is awesome!</h1>
<p>I am coding in html!
This is so cool!</p>
</body>
</html>
<SomeComponent name="This is the 'name' prop of this component"q />
class Comment extends Component {
state : {
comment: "Wow, so cool!"
}
}
function Comment (props) {
return (
<p>{props.comment}</p>
);
}