Skip to content

Instantly share code, notes, and snippets.

Avatar
💫

Dimitry Zub☀️ dimitryzub

💫
View GitHub Profile
@dimitryzub
dimitryzub / python_scrape_bing_related_searches.py
Created Jun 26, 2021
python_scrape_bing_related_searches
View python_scrape_bing_related_searches.py
@dimitryzub
dimitryzub / python_scrape_bing_related_search_results.py
Created Jun 26, 2021
python_scrape_bing_related_search_results
View python_scrape_bing_related_search_results.py
View youtube_get_movie_results.py
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
def get_movie_results():
options = Options()
# running selenium in headless mode
options.headless = True
driver = webdriver.Chrome(options=options)
driver.get('https://www.youtube.com/results?search_query=mortal kombat 2021 movie')
View youtube_get_category_results.py
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
def get_category_results():
options = Options()
# running selenium in headless mode
options.headless = True
driver = webdriver.Chrome(options=options)
driver.get('https://www.youtube.com/results?search_query=mojang')
@dimitryzub
dimitryzub / youtube_serpapi_get_category_results.py
Created Jun 21, 2021
youtube_serpapi_get_category_results
View youtube_serpapi_get_category_results.py
from serpapi import GoogleSearch
def get_category_results():
params = {
"api_key": "YOR_API_KEY",
"engine": "youtube",
"search_query": "mojang"
}
search = GoogleSearch(params)
@dimitryzub
dimitryzub / youtube_serpapi_get_movie_results.py
Last active Jun 21, 2021
youtube_serpapi_get_movie_results
View youtube_serpapi_get_movie_results.py
from serpapi import GoogleSearch
def get_movie_results():
params = {
"api_key": "YOUR_API_KEY",
"engine": "youtube",
"search_query": "mortal kombat 2021 movie"
}
search = GoogleSearch(params)
@dimitryzub
dimitryzub / serpapi_youtube_get_movie_results.py
Last active Jun 21, 2021
serpapi_youtube_get_movie_results
View serpapi_youtube_get_movie_results.py
from serpapi import GoogleSearch
def get_movie_results():
params = {
"api_key": "YOUR_API_KEY",
"engine": "youtube",
"search_query": "mortal kombat 2021 movie"
}
search = GoogleSearch(params)
@dimitryzub
dimitryzub / youtube_get_video_paylist_results.py
Created Jun 21, 2021
youtube_get_video_paylist_results
View youtube_get_video_paylist_results.py
import json
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
def get_video_paylist_results():
options = Options()
# running selenium in headless mode
options.headless = True
driver = webdriver.Chrome(options=options)
driver.get('https://www.youtube.com/results?search_query=dnb playlist')
View serpapi_youtube_get_channel.py
from serpapi import GoogleSearch
def get_channel_results():
params = {
"api_key": "YOUR_API_KEY",
"engine": "youtube",
"search_query": "mojang"
}
search = GoogleSearch(params)
View selenium_youtube_get_channel.py
from selenium import webdriver
def get_channel_results():
driver = webdriver.Chrome()
driver.get('https://www.youtube.com/results?search_query=mojang')
title = driver.find_element_by_css_selector('#info #text').text
link = driver.find_element_by_css_selector('#main-link').get_attribute('href')
subs = driver.find_element_by_css_selector('#subscribers').text
video_count = driver.find_element_by_css_selector('#video-count').text