Skip to content

Instantly share code, notes, and snippets.

Avatar

Alla Tambovtseva allatambov

View GitHub Profile
View get-info04.py
def get_info(my_link):
my_page = requests.get(my_link)
my_soup = BeautifulSoup(my_page.text)
author = my_soup.find("meta",
{"name" : "mediator_author"})["content"]
date = my_soup.find("meta",
{"itemprop" : "datePublished"})["content"]
title = my_soup.find("title").text
desc = my_soup.find("meta",
{"name" : "description"})["content"]
View get-info03.py
def get_info(my_link):
my_page = requests.get(my_link)
my_soup = BeautifulSoup(my_page.text)
author = my_soup.find("meta",
{"name" : "mediator_author"})["content"]
date = my_soup.find("meta",
{"itemprop" : "datePublished"})["content"]
title = my_soup.find("title").text
desc = my_soup.find("meta",
{"name" : "description"})["content"]
View get-info02.py
def get_info(my_link):
my_page = requests.get(my_link)
my_soup = BeautifulSoup(my_page.text)
author = my_soup.find("meta",
{"name" : "mediator_author"})["content"]
date = my_soup.find("meta",
{"itemprop" : "datePublished"})["content"]
title = my_soup.find("title").text
desc = my_soup.find("meta",
{"name" : "description"})["content"]
View get-info.py
def get_info(my_link):
my_page = requests.get(my_link)
my_soup = BeautifulSoup(my_page.text)
author = my_soup.find("meta",
{"name" : "mediator_author"})["content"]
date = my_soup.find("meta",
{"itemprop" : "datePublished"})["content"]
title = my_soup.find("title").text
desc = my_soup.find("meta",
{"name" : "description"})["content"]
View no
city = br.find_element_by_id("cCity")
city_inp = city.find_element_by_tag_name("input")
city_inp.send_keys("Москва")
br.implicitly_wait(1.5)
city_inp.send_keys(Keys.RETURN)
sex = br.find_element_by_id("cSex")
values = sex.find_elements_by_tag_name("div")
values
View part01
br = wd.Chrome("/Users/allat/Downloads/chromedriver")
br.get("https://vk.com/")
login = br.find_element_by_id("index_email")
login.send_keys("allatambov@mail.ru")
password = br.find_element_by_id("index_pass")
# enter your password here
password.send_keys("")
View gist:304182891a67a8fe93905ef542f25e3a
from selenium import webdriver as wd
br = wd.Chrome("/Users/allat/Desktop/chromedriver")
# br = wd.Chrome("C://Users/allat/Desktop/chromedriver.exe")
br.get("http://www.biblio-globus.ru/")
search = br.find_element_by_id("search_string")
search.clear()
search.send_keys("Python")
button = br.find_element_by_id("search_submit")
View start.py
from selenium import webdriver as wd
# enter your path here
br = wd.Chrome("/Users/allat/Downloads/chromedriver")
br.get("https://vk.com/")
login = br.find_element_by_id("index_email")
login.send_keys("allatambov@mail.ru")
password = br.find_element_by_id("index_pass")
View soup-links
View soup
import requests
from bs4 import BeautifulSoup
page = requests.get("http://nplus1.ru/")
soup = BeautifulSoup(page.text)
links_raw = soup.find_all("a")
links_all = []
for link in links_raw:
links_all.append(link["href"])