Skip to content

Instantly share code, notes, and snippets.

View dimitryzub's full-sized avatar
🇺🇦
Grateful

Dmitiry Zub☀️ dimitryzub

🇺🇦
Grateful
View GitHub Profile
@dimitryzub
dimitryzub / ebay_serpapi_get_related_items.py
Created June 20, 2021 05:00
ebay_serpapi_get_related_items
@dimitryzub
dimitryzub / youtube_get_search_results.py
Last active August 28, 2021 15:01
youtube_get_search_results
from selenium import webdriver
import json, time
def get_video_results():
driver = webdriver.Chrome()
driver.get('https://www.youtube.com/results?search_query=minecraft')
youtube_data = []
@dimitryzub
dimitryzub / youtube_serpapi_get_search_results.py
Created June 20, 2021 05:05
youtube_serpapi_get_search_results
from serpapi import GoogleSearch
def get_video_results():
params = {
"api_key": "YOUR_API_KEY",
"engine": "youtube",
"search_query": "minecraft"
}
search = GoogleSearch(params)
@dimitryzub
dimitryzub / selenium_youtube_get_ads.py
Created June 20, 2021 05:05
selenium_youtube_get_ads
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
def get_video_ad_results():
options = Options()
options.headless = True
driver = webdriver.Chrome(options=options)
driver.get('https://www.youtube.com/results?search_query=how to tie a tie')
for result in driver.find_elements_by_css_selector('.style-scope ytd-search-pyv-renderer'):
@dimitryzub
dimitryzub / serpapi_youtube_get_ads.py
Created June 20, 2021 05:06
serpapi_youtube_get_ads
from serpapi import GoogleSearch
def get_video_ad_results():
params = {
"api_key": "YOUR_API_KEY",
"engine": "youtube",
"search_query": "how to tie a tie"
}
search = GoogleSearch(params)
@dimitryzub
dimitryzub / selenium_youtube_get_channel.py
Created June 20, 2021 05:06
selenium_youtube_get_channel
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
@dimitryzub
dimitryzub / serpapi_youtube_get_channel.py
Created June 20, 2021 05:07
serpapi_youtube_get_channel
from serpapi import GoogleSearch
def get_channel_results():
params = {
"api_key": "YOUR_API_KEY",
"engine": "youtube",
"search_query": "mojang"
}
search = GoogleSearch(params)
@dimitryzub
dimitryzub / youtube_get_video_paylist_results.py
Created June 21, 2021 10:13
youtube_get_video_paylist_results
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')
@dimitryzub
dimitryzub / serpapi_youtube_get_movie_results.py
Last active June 21, 2021 10:45
serpapi_youtube_get_movie_results
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_serpapi_get_movie_results.py
Last active June 21, 2021 10:44
youtube_serpapi_get_movie_results
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)