Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tools:selenium [2025/02/24 21:54] – [Test] darrontools:selenium [2025/02/26 12:49] (current) – [Test] darron
Line 24: Line 24:
 <code> <code>
 python -m pip install --upgrade pip python -m pip install --upgrade pip
-pip install selenium +python -m pip install selenium  
 +</code> 
 + 
 +==Install tools== 
 + 
 +Here are a few tool which can be useful for tidying HTML content 
 +for evaluation and for storing scraped data in a [[:tools:wikibase|Wikibase]]. 
 + 
 +<code> 
 +python -m pip install lxml 
 +python -m pip install beautifulsoup4 
 +python -m pip install "WikibaseIntegrator>=0.12" 
 +python -m pip install dotenv
 </code> </code>
  
Line 37: Line 49:
 </code> </code>
  
 +__bash__
 +<code>
 +alias py="/mnt/c/Users/username/AppData/Local/Programs/Python/Python313/python.exe"
 +</code>
 ===Test=== ===Test===
  
Line 45: Line 61:
  
 from selenium import webdriver from selenium import webdriver
 +# CHROME
 from selenium.webdriver.chrome.options import Options from selenium.webdriver.chrome.options import Options
 +# FIREFOX
 #from selenium.webdriver.firefox.options import Options #from selenium.webdriver.firefox.options import Options
-from time import sleep 
  
 options = Options() options = Options()
  
 +# CHROME
 options.add_argument("--incognito") options.add_argument("--incognito")
 driver = webdriver.Chrome(options=options) driver = webdriver.Chrome(options=options)
 +# FIREFOX
 #options.add_argument("-private") #options.add_argument("-private")
 #driver = webdriver.Firefox(options=options) #driver = webdriver.Firefox(options=options)
  
-driver.get("https://www.deckenmalerei.eu/") +driver.implicitly_wait(60) 
-sleep(30)+driver.get("https://www.kewl.org/") 
 driver.quit() driver.quit()
 </code> </code>
  
-Incognito mode was found to be a requirement on a Linux host otherwise chromium would take +CHROME incognito mode was found to be a requirement on a Linux host otherwise chromium would wait 
-about 30 seconds to open the first URL.+about 30 seconds before opening the URL.
 ===Resources=== ===Resources===
  
 [[https://github.com/vim/vim-win32-installer/releases/download/v9.1.0/gvim_9.1.0_x64_signed.exe|VIM for AMD64]] [[https://github.com/vim/vim-win32-installer/releases/download/v9.1.0/gvim_9.1.0_x64_signed.exe|VIM for AMD64]]