View gist:c0e4b30f0a71e76c65b3129fbe0d7604
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
import requests | |
from bs4 import BeautifulSoup | |
page = requests.get("https://cash.rbc.ru/") | |
soup = BeautifulSoup(page.text) | |
divs = soup.find_all("div", {"class" : "quote__office__one js-one-office"}) | |
d = divs[0] | |
link = d.find("a", {"class" : "quote__office__one__name"}) | |
name = link.text |
View get-info04.py
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
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
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
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
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
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
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
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
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
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
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
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
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 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
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 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
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
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"]) |
NewerOlder