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 | |
import json, time | |
def get_video_results(): | |
driver = webdriver.Chrome() | |
driver.get('https://www.youtube.com/results?search_query=minecraft') | |
youtube_data = [] |
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 serpapi import GoogleSearch | |
def get_video_results(): | |
params = { | |
"api_key": "YOUR_API_KEY", | |
"engine": "youtube", | |
"search_query": "minecraft" | |
} | |
search = GoogleSearch(params) |
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 | |
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'): |
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 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) |
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 | |
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 |
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 serpapi import GoogleSearch | |
def get_channel_results(): | |
params = { | |
"api_key": "YOUR_API_KEY", | |
"engine": "youtube", | |
"search_query": "mojang" | |
} | |
search = GoogleSearch(params) |
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 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') |
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 serpapi import GoogleSearch | |
def get_movie_results(): | |
params = { | |
"api_key": "YOUR_API_KEY", | |
"engine": "youtube", | |
"search_query": "mortal kombat 2021 movie" | |
} | |
search = GoogleSearch(params) |
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 serpapi import GoogleSearch | |
def get_movie_results(): | |
params = { | |
"api_key": "YOUR_API_KEY", | |
"engine": "youtube", | |
"search_query": "mortal kombat 2021 movie" | |
} | |
search = GoogleSearch(params) |