added a semi functional scraper
it needs to be in a country that doesn't have age verification to work (like the US or japan), or a twitter account that's verified
This commit is contained in:
19
scrape.py
Normal file
19
scrape.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from selenium import webdriver
|
||||
from time import sleep
|
||||
|
||||
def get_page(url):
|
||||
profile = webdriver.FirefoxProfile("./ffprofile/")
|
||||
options = webdriver.FirefoxOptions()
|
||||
options.add_argument("--headless")
|
||||
options.profile=profile
|
||||
driver = webdriver.Firefox(options)
|
||||
|
||||
print("sending get request...")
|
||||
driver.get(url)
|
||||
print("waiting for page to load...")
|
||||
sleep(10)
|
||||
|
||||
return driver.page_source
|
||||
|
||||
if __name__ == "__main__":
|
||||
get_page("https://x.com/wata_ruh/status/2011037668386148484")
|
||||
Reference in New Issue
Block a user