Browse Source

removed opentor() from all crawlers and set permissions.default.image to 3

main
westernmeadow 1 year ago
parent
commit
cca45ad92f
35 changed files with 111 additions and 564 deletions
  1. +1
    -1
      .idea/DW_Pipeline_Test.iml
  2. +1
    -1
      .idea/misc.xml
  3. +2
    -16
      Forums/AbyssForum/crawler_selenium.py
  4. +2
    -16
      Forums/Altenens/crawler_selenium.py
  5. +3
    -18
      Forums/BestCardingWorld/crawler_selenium.py
  6. +2
    -16
      Forums/Cardingleaks/crawler_selenium.py
  7. +2
    -16
      Forums/CryptBB/crawler_selenium.py
  8. +2
    -16
      Forums/HiddenAnswers/crawler_selenium.py
  9. +8
    -1
      Forums/Initialization/forumsList.txt
  10. +2
    -16
      Forums/Libre/crawler_selenium.py
  11. +2
    -17
      Forums/OnniForums/crawler_selenium.py
  12. +2
    -16
      Forums/Procrax/crawler_selenium.py
  13. +4
    -18
      MarketPlaces/AnonymousMarketplace/crawler_selenium.py
  14. +2
    -16
      MarketPlaces/Apocalypse/crawler_selenium.py
  15. +3
    -18
      MarketPlaces/BlackPyramid/crawler_selenium.py
  16. +3
    -18
      MarketPlaces/CityMarket/crawler_selenium.py
  17. +3
    -18
      MarketPlaces/CypherMarketplace/crawler_selenium.py
  18. +3
    -17
      MarketPlaces/DarkBazar/crawler_selenium.py
  19. +6
    -21
      MarketPlaces/DarkFox/crawler_selenium.py
  20. +3
    -19
      MarketPlaces/DarkMatter/crawler_selenium.py
  21. +4
    -18
      MarketPlaces/DarkTor/crawler_selenium.py
  22. +2
    -16
      MarketPlaces/DigitalThriftShop/crawler_selenium.py
  23. +6
    -20
      MarketPlaces/HiddenMarket/crawler_selenium.py
  24. +3
    -18
      MarketPlaces/LionMarketplace/crawler_selenium.py
  25. +3
    -18
      MarketPlaces/M00nkeyMarket/crawler_selenium.py
  26. +3
    -18
      MarketPlaces/MetaVerseMarket/crawler_selenium.py
  27. +4
    -18
      MarketPlaces/MikesGrandStore/crawler_selenium.py
  28. +4
    -16
      MarketPlaces/Nexus/crawler_selenium.py
  29. +7
    -19
      MarketPlaces/PabloEscobarMarket/crawler_selenium.py
  30. +2
    -18
      MarketPlaces/RobinhoodMarket/crawler_selenium.py
  31. +3
    -18
      MarketPlaces/ThiefWorld/crawler_selenium.py
  32. +2
    -16
      MarketPlaces/Tor2door/crawler_selenium.py
  33. +3
    -17
      MarketPlaces/TorBay/crawler_selenium.py
  34. +3
    -18
      MarketPlaces/TorMarket/crawler_selenium.py
  35. +6
    -21
      MarketPlaces/ViceCity/crawler_selenium.py

+ 1
- 1
.idea/DW_Pipeline_Test.iml View File

@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4"> <module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" /> <content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="C:\Users\calsyslab\anaconda3" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
<component name="PyNamespacePackagesService"> <component name="PyNamespacePackagesService">


+ 1
- 1
.idea/misc.xml View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="C:\Users\calsyslab\anaconda3" project-jdk-type="Python SDK" />
</project> </project>

+ 2
- 16
Forums/AbyssForum/crawler_selenium.py View File

@ -30,7 +30,6 @@ baseURL = 'http://qyvjopwdgjq52ehsx6paonv2ophy3p4ivfkul4svcaw6qxlzsaboyjid.onion
# Opens Tor Browser, crawls the website # Opens Tor Browser, crawls the website
def startCrawling(): def startCrawling():
# opentor()
forumName = getForumName() forumName = getForumName()
driver = getAccess() driver = getAccess()
@ -40,24 +39,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(forumName, baseURL, True) new_parse(forumName, baseURL, True)
# Opens Tor Browser
def opentor():
from Forums.Initialization.forums_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Login using premade account credentials and do login captcha manually # Login using premade account credentials and do login captcha manually
def login(driver): def login(driver):
# wait for listing page show up (This Xpath may need to change based on different seed url) # wait for listing page show up (This Xpath may need to change based on different seed url)
@ -78,7 +64,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")


+ 2
- 16
Forums/Altenens/crawler_selenium.py View File

@ -30,7 +30,6 @@ baseURL = 'https://altenens.is/'
# Opens Tor Browser, crawls the website # Opens Tor Browser, crawls the website
def startCrawling(): def startCrawling():
# opentor()
forumName = getForumName() forumName = getForumName()
driver = getAccess() driver = getAccess()
@ -40,24 +39,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(forumName, baseURL, True) new_parse(forumName, baseURL, True)
# Opens Tor Browser
def opentor():
from Forums.Initialization.forums_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Login using premade account credentials and do login captcha manually # Login using premade account credentials and do login captcha manually
def login(driver): def login(driver):
#click login button #click login button
@ -93,7 +79,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")


+ 3
- 18
Forums/BestCardingWorld/crawler_selenium.py View File

@ -27,7 +27,6 @@ baseURL = 'http://bestteermb42clir6ux7xm76d4jjodh3fpahjqgbddbmfrgp4skg2wqd.onion
# Opens Tor Browser, crawls the website, then parses, then closes tor # Opens Tor Browser, crawls the website, then parses, then closes tor
#acts like the main method for the crawler, another function at the end of this code calls this function later #acts like the main method for the crawler, another function at the end of this code calls this function later
def startCrawling(): def startCrawling():
# opentor()
forumName = getForumName() forumName = getForumName()
driver = getAccess() driver = getAccess()
@ -36,25 +35,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(forumName, baseURL, True) new_parse(forumName, baseURL, True)
# Opens Tor Browser
#prompts for ENTER input to continue
def opentor():
from Forums.Initialization.forums_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
#return: name of site in string type #return: name of site in string type
def getForumName(): def getForumName():
@ -71,7 +56,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
#@param: current selenium driver #@param: current selenium driver
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -98,7 +83,7 @@ def createFFDriver():
ff_prof.set_preference("network.cookie.lifetimePolicy", 2) ff_prof.set_preference("network.cookie.lifetimePolicy", 2)
ff_prof.set_preference("network.dns.disablePrefetch", True)#might need to turn off ff_prof.set_preference("network.dns.disablePrefetch", True)#might need to turn off
ff_prof.set_preference("network.http.sendRefererHeader", 0) ff_prof.set_preference("network.http.sendRefererHeader", 0)
ff_prof.set_preference("permissions.default.image", 2)
ff_prof.set_preference("permissions.default.image", 3)
ff_prof.set_preference("browser.download.folderList", 2) ff_prof.set_preference("browser.download.folderList", 2)
ff_prof.set_preference("browser.download.manager.showWhenStarting", False) ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain") ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")


+ 2
- 16
Forums/Cardingleaks/crawler_selenium.py View File

@ -32,7 +32,6 @@ baseURL = 'https://leaks.ws/'
# Opens Tor Browser, crawls the website # Opens Tor Browser, crawls the website
def startCrawling(): def startCrawling():
# opentor()
forumName = getForumName() forumName = getForumName()
driver = getAccess() driver = getAccess()
@ -42,24 +41,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(forumName, baseURL, True) new_parse(forumName, baseURL, True)
# Opens Tor Browser
def opentor():
from Forums.Initialization.forums_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Login using premade account credentials and do login captcha manually # Login using premade account credentials and do login captcha manually
def login(driver): def login(driver):
#click login button #click login button
@ -101,7 +87,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")


+ 2
- 16
Forums/CryptBB/crawler_selenium.py View File

@ -28,7 +28,6 @@ baseURL = 'http://cryptbbtg65gibadeeo2awe3j7s6evg7eklserehqr4w4e2bis5tebid.onion
# Opens Tor Browser, crawls the website # Opens Tor Browser, crawls the website
def startCrawling(): def startCrawling():
# opentor()
forumName = getForumName() forumName = getForumName()
driver = getAccess() driver = getAccess()
@ -38,24 +37,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(forumName, baseURL, True) new_parse(forumName, baseURL, True)
# Opens Tor Browser
def opentor():
from Forums.Initialization.forums_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Login using premade account credentials and do login captcha manually # Login using premade account credentials and do login captcha manually
def login(driver): def login(driver):
#click login button #click login button
@ -119,7 +105,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")


+ 2
- 16
Forums/HiddenAnswers/crawler_selenium.py View File

@ -30,7 +30,6 @@ baseURL = 'http://7eoz4h2nvw4zlr7gvlbutinqqpm546f5egswax54az6lt2u7e3t6d7yd.onion
# Opens Tor Browser, crawls the website # Opens Tor Browser, crawls the website
def startCrawling(): def startCrawling():
# opentor()
forumName = getForumName() forumName = getForumName()
driver: webdriver.Firefox = getAccess() driver: webdriver.Firefox = getAccess()
@ -40,24 +39,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(forumName, baseURL, True) new_parse(forumName, baseURL, True)
# Opens Tor Browser
def opentor():
from Forums.Initialization.forums_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Login using premade account credentials and do login captcha manually # Login using premade account credentials and do login captcha manually
def login(driver): def login(driver):
# wait for listing page show up (This Xpath may need to change based on different seed url) # wait for listing page show up (This Xpath may need to change based on different seed url)
@ -78,7 +64,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")


+ 8
- 1
Forums/Initialization/forumsList.txt View File

@ -1 +1,8 @@
BestCardingWorld
Altenens
BestCardingWorld
Cardingleaks
CryptBB
HiddenAnswers
Libre
OnniForums
Procrax

+ 2
- 16
Forums/Libre/crawler_selenium.py View File

@ -28,7 +28,6 @@ baseURL = 'http://libreeunomyly6ot7kspglmbd5cvlkogib6rozy43r2glatc6rmwauqd.onion
# Opens Tor Browser, crawls the website # Opens Tor Browser, crawls the website
def startCrawling(): def startCrawling():
# opentor()
forumName = getForumName() forumName = getForumName()
driver = getAccess() driver = getAccess()
@ -38,24 +37,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(forumName, baseURL, True) new_parse(forumName, baseURL, True)
# Opens Tor Browser
def opentor():
from Forums.Initialization.forums_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Login using premade account credentials and do login captcha manually # Login using premade account credentials and do login captcha manually
def login(driver): def login(driver):
@ -101,7 +87,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")


+ 2
- 17
Forums/OnniForums/crawler_selenium.py View File

@ -31,7 +31,6 @@ baseURL = 'http://onnii6niq53gv3rvjpi7z5axkasurk2x5w5lwliep4qyeb2azagxn4qd.onion
# Opens Tor Browser, crawls the website # Opens Tor Browser, crawls the website
def startCrawling(): def startCrawling():
# opentor()
forumName = getForumName() forumName = getForumName()
driver = getAccess() driver = getAccess()
@ -41,24 +40,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(forum=forumName, url=baseURL, createLog=True) new_parse(forum=forumName, url=baseURL, createLog=True)
# Opens Tor Browser
def opentor():
from Forums.Initialization.forums_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Login using premade account credentials and do login captcha manually # Login using premade account credentials and do login captcha manually
def login(driver): def login(driver):
#click login button #click login button
@ -96,7 +82,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -141,7 +127,6 @@ def createFFDriver():
driver.maximize_window() driver.maximize_window()
return driver return driver


+ 2
- 16
Forums/Procrax/crawler_selenium.py View File

@ -32,7 +32,6 @@ FORUM_NAME = 'Procrax'
# Opens Tor Browser, crawls the website # Opens Tor Browser, crawls the website
def startCrawling(): def startCrawling():
# opentor()
driver = getAccess() driver = getAccess()
if driver != 'down': if driver != 'down':
@ -41,7 +40,7 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse( new_parse(
forum=FORUM_NAME, forum=FORUM_NAME,
@ -50,19 +49,6 @@ def startCrawling():
) )
# Opens Tor Browser
def opentor():
from Forums.Initialization.forums_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Login using premade account credentials and do login captcha manually # Login using premade account credentials and do login captcha manually
def login(driver): def login(driver):
WebDriverWait(driver, 50).until(EC.visibility_of_element_located( WebDriverWait(driver, 50).until(EC.visibility_of_element_located(
@ -97,7 +83,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")


+ 4
- 18
MarketPlaces/AnonymousMarketplace/crawler_selenium.py View File

@ -32,7 +32,6 @@ baseURL = 'http://3fqr7fgjaslhgmeiin5e2ky6ra5xkiafyzg7i36sfcehv3jvpgydteqd.onion
# Opens Tor Browser, crawls the website, then parses, then closes tor # Opens Tor Browser, crawls the website, then parses, then closes tor
#acts like the main method for the crawler, another function at the end of this code calls this function later #acts like the main method for the crawler, another function at the end of this code calls this function later
def startCrawling(): def startCrawling():
# opentor()
mktName = getMKTName() mktName = getMKTName()
driver = getAccess() driver = getAccess()
@ -42,25 +41,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(mktName, baseURL, True) new_parse(mktName, baseURL, True)
# Opens Tor Browser
#prompts for ENTER input to continue
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
#return: name of site in string type #return: name of site in string type
def getMKTName(): def getMKTName():
@ -77,7 +62,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
#@param: current selenium driver #@param: current selenium driver
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -104,7 +89,7 @@ def createFFDriver():
ff_prof.set_preference("network.cookie.lifetimePolicy", 2) ff_prof.set_preference("network.cookie.lifetimePolicy", 2)
ff_prof.set_preference("network.dns.disablePrefetch", True) ff_prof.set_preference("network.dns.disablePrefetch", True)
ff_prof.set_preference("network.http.sendRefererHeader", 0) ff_prof.set_preference("network.http.sendRefererHeader", 0)
ff_prof.set_preference("permissions.default.image", 1)
ff_prof.set_preference("permissions.default.image", 3)
ff_prof.set_preference("browser.download.folderList", 2) ff_prof.set_preference("browser.download.folderList", 2)
ff_prof.set_preference("browser.download.manager.showWhenStarting", False) ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain") ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")
@ -146,6 +131,7 @@ def login(driver):
WebDriverWait(driver, 100).until(EC.visibility_of_element_located( WebDriverWait(driver, 100).until(EC.visibility_of_element_located(
(By.ID, "woocommerce_product_categories-2"))) (By.ID, "woocommerce_product_categories-2")))
# Saves the crawled html page, makes the directory path for html pages if not made # Saves the crawled html page, makes the directory path for html pages if not made
def savePage(driver, page, url): def savePage(driver, page, url):
cleanPage = cleanHTML(driver, page) cleanPage = cleanHTML(driver, page)


+ 2
- 16
MarketPlaces/Apocalypse/crawler_selenium.py View File

@ -32,7 +32,6 @@ baseURL = 'http://apocam5hnoqskkmhr325nivjuh5phbmmggadxgcjabzzirap5iklkxad.onion
# Opens Tor Browser, crawls the website, then parses, then closes tor # Opens Tor Browser, crawls the website, then parses, then closes tor
#acts like the main method for the crawler, another function at the end of this code calls this function later #acts like the main method for the crawler, another function at the end of this code calls this function later
def startCrawling(): def startCrawling():
# opentor()
mktName = getMKTName() mktName = getMKTName()
driver = getAccess() driver = getAccess()
@ -47,20 +46,6 @@ def startCrawling():
new_parse(mktName, baseURL, True) new_parse(mktName, baseURL, True)
# Opens Tor Browser
#prompts for ENTER input to continue
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
#return: name of site in string type #return: name of site in string type
def getMKTName(): def getMKTName():
@ -104,7 +89,7 @@ def createFFDriver():
ff_prof.set_preference("network.cookie.lifetimePolicy", 2) ff_prof.set_preference("network.cookie.lifetimePolicy", 2)
ff_prof.set_preference("network.dns.disablePrefetch", True) ff_prof.set_preference("network.dns.disablePrefetch", True)
ff_prof.set_preference("network.http.sendRefererHeader", 0) ff_prof.set_preference("network.http.sendRefererHeader", 0)
ff_prof.set_preference("permissions.default.image", 1)##
ff_prof.set_preference("permissions.default.image", 3)
ff_prof.set_preference("browser.download.folderList", 2) ff_prof.set_preference("browser.download.folderList", 2)
ff_prof.set_preference("browser.download.manager.showWhenStarting", False) ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain") ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")
@ -162,6 +147,7 @@ def login(driver):
WebDriverWait(driver, 100).until(EC.visibility_of_element_located( WebDriverWait(driver, 100).until(EC.visibility_of_element_located(
(By.XPATH, "/html/body/div[1]/div[2]/div[1]/div[1]/a[13]"))) (By.XPATH, "/html/body/div[1]/div[2]/div[1]/div[1]/a[13]")))
# Saves the crawled html page, makes the directory path for html pages if not made # Saves the crawled html page, makes the directory path for html pages if not made
def savePage(driver, page, url): def savePage(driver, page, url):
cleanPage = cleanHTML(driver, page) cleanPage = cleanHTML(driver, page)


+ 3
- 18
MarketPlaces/BlackPyramid/crawler_selenium.py View File

@ -33,7 +33,6 @@ baseURL = 'http://blackpyoc3gbnrlvxqvvytd3kxqj7pd226i2gvfyhysj24ne2snkmnyd.onion
# Opens Tor Browser, crawls the website, then parses, then closes tor # Opens Tor Browser, crawls the website, then parses, then closes tor
#acts like the main method for the crawler, another function at the end of this code calls this function later #acts like the main method for the crawler, another function at the end of this code calls this function later
def startCrawling(): def startCrawling():
# opentor()
mktName = getMKTName() mktName = getMKTName()
driver = getAccess() driver = getAccess()
@ -43,25 +42,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(mktName, baseURL, True) new_parse(mktName, baseURL, True)
# Opens Tor Browser
#prompts for ENTER input to continue
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
#return: name of site in string type #return: name of site in string type
def getMKTName(): def getMKTName():
@ -78,7 +63,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
#@param: current selenium driver #@param: current selenium driver
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -105,7 +90,7 @@ def createFFDriver():
ff_prof.set_preference("network.cookie.lifetimePolicy", 2) ff_prof.set_preference("network.cookie.lifetimePolicy", 2)
ff_prof.set_preference("network.dns.disablePrefetch", True) ff_prof.set_preference("network.dns.disablePrefetch", True)
ff_prof.set_preference("network.http.sendRefererHeader", 0) ff_prof.set_preference("network.http.sendRefererHeader", 0)
ff_prof.set_preference("permissions.default.image", 2)
ff_prof.set_preference("permissions.default.image", 3)
ff_prof.set_preference("browser.download.folderList", 2) ff_prof.set_preference("browser.download.folderList", 2)
ff_prof.set_preference("browser.download.manager.showWhenStarting", False) ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain") ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")


+ 3
- 18
MarketPlaces/CityMarket/crawler_selenium.py View File

@ -33,7 +33,6 @@ baseURL = 'http://wsptlnuoo3johqzcdlwuj5zcwfh2dwmswz6hahqctuxttvxpanypmwad.onion
# Opens Tor Browser, crawls the website, then parses, then closes tor # Opens Tor Browser, crawls the website, then parses, then closes tor
#acts like the main method for the crawler, another function at the end of this code calls this function later #acts like the main method for the crawler, another function at the end of this code calls this function later
def startCrawling(): def startCrawling():
# opentor()
mktName = getMKTName() mktName = getMKTName()
driver = getAccess() driver = getAccess()
@ -43,25 +42,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(mktName, baseURL, True) new_parse(mktName, baseURL, True)
# Opens Tor Browser
#prompts for ENTER input to continue
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
#return: name of site in string type #return: name of site in string type
def getMKTName(): def getMKTName():
@ -78,7 +63,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
#@param: current selenium driver #@param: current selenium driver
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -105,7 +90,7 @@ def createFFDriver():
ff_prof.set_preference("network.cookie.lifetimePolicy", 2) ff_prof.set_preference("network.cookie.lifetimePolicy", 2)
ff_prof.set_preference("network.dns.disablePrefetch", True) ff_prof.set_preference("network.dns.disablePrefetch", True)
ff_prof.set_preference("network.http.sendRefererHeader", 0) ff_prof.set_preference("network.http.sendRefererHeader", 0)
ff_prof.set_preference("permissions.default.image", 1)##
ff_prof.set_preference("permissions.default.image", 3)
ff_prof.set_preference("browser.download.folderList", 2) ff_prof.set_preference("browser.download.folderList", 2)
ff_prof.set_preference("browser.download.manager.showWhenStarting", False) ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain") ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")


+ 3
- 18
MarketPlaces/CypherMarketplace/crawler_selenium.py View File

@ -32,7 +32,6 @@ baseURL = 'http://6c5qa2ke2esh6ake6u6yoxjungz2czbbl7hqxl75v5k37frtzhxuk7ad.onion
# Opens Tor Browser, crawls the website, then parses, then closes tor # Opens Tor Browser, crawls the website, then parses, then closes tor
#acts like the main method for the crawler, another function at the end of this code calls this function later #acts like the main method for the crawler, another function at the end of this code calls this function later
def startCrawling(): def startCrawling():
# opentor()
mktName = getMKTName() mktName = getMKTName()
driver = getAccess() driver = getAccess()
@ -42,25 +41,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(mktName, baseURL, True) new_parse(mktName, baseURL, True)
# Opens Tor Browser
#prompts for ENTER input to continue
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
#return: name of site in string type #return: name of site in string type
def getMKTName(): def getMKTName():
@ -77,7 +62,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
#@param: current selenium driver #@param: current selenium driver
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -104,7 +89,7 @@ def createFFDriver():
ff_prof.set_preference("network.cookie.lifetimePolicy", 2) ff_prof.set_preference("network.cookie.lifetimePolicy", 2)
ff_prof.set_preference("network.dns.disablePrefetch", True) ff_prof.set_preference("network.dns.disablePrefetch", True)
ff_prof.set_preference("network.http.sendRefererHeader", 0) ff_prof.set_preference("network.http.sendRefererHeader", 0)
ff_prof.set_preference("permissions.default.image", 2)
ff_prof.set_preference("permissions.default.image", 3)
ff_prof.set_preference("browser.download.folderList", 2) ff_prof.set_preference("browser.download.folderList", 2)
ff_prof.set_preference("browser.download.manager.showWhenStarting", False) ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain") ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")


+ 3
- 17
MarketPlaces/DarkBazar/crawler_selenium.py View File

@ -30,7 +30,6 @@ baseURL = 'http://jw5e5sdywqupaqgtt43uq5ysfqpd2vzefl65s2fcjlj4qfxivynv6bqd.onion
def startCrawling(): def startCrawling():
# opentor()
mktName = getMKTName() mktName = getMKTName()
driver = getAccess() driver = getAccess()
@ -40,24 +39,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(mktName, baseURL, True) new_parse(mktName, baseURL, True)
# Opens Tor Browser
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
def getMKTName(): def getMKTName():
name = 'DarkBazar' name = 'DarkBazar'
@ -71,7 +57,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -98,7 +84,7 @@ def createFFDriver():
ff_prof.set_preference("network.cookie.lifetimePolicy", 2) ff_prof.set_preference("network.cookie.lifetimePolicy", 2)
# ff_prof.set_preference("network.dns.disablePrefetch", True) # ff_prof.set_preference("network.dns.disablePrefetch", True)
# ff_prof.set_preference("network.http.sendRefererHeader", 0) # ff_prof.set_preference("network.http.sendRefererHeader", 0)
ff_prof.set_preference("permissions.default.image", 1)
ff_prof.set_preference("permissions.default.image", 3)
ff_prof.set_preference("browser.download.folderList", 2) ff_prof.set_preference("browser.download.folderList", 2)
ff_prof.set_preference("browser.download.manager.showWhenStarting", False) ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain") ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")


+ 6
- 21
MarketPlaces/DarkFox/crawler_selenium.py View File

@ -30,7 +30,6 @@ baseURL = 'http://57d5j6bbwlpxbxe5tsjjy3vziktv3fo2o5j3nheo4gpg6lzpsimzqzid.onion
# Opens Tor Browser, crawls the website, then parses, then closes tor # Opens Tor Browser, crawls the website, then parses, then closes tor
#acts like the main method for the crawler, another function at the end of this code calls this function later #acts like the main method for the crawler, another function at the end of this code calls this function later
def startCrawling(): def startCrawling():
# opentor()
mktName = getMKTName() mktName = getMKTName()
driver = getAccess() driver = getAccess()
@ -40,25 +39,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(mktName, baseURL, True) new_parse(mktName, baseURL, True)
# Opens Tor Browser
#prompts for ENTER input to continue
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
#return: name of site in string type #return: name of site in string type
def getMKTName(): def getMKTName():
@ -81,7 +66,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
#@param: current selenium driver #@param: current selenium driver
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -108,10 +93,10 @@ def createFFDriver():
# ff_prof.set_preference("network.cookie.lifetimePolicy", 2) # ff_prof.set_preference("network.cookie.lifetimePolicy", 2)
# ff_prof.set_preference("network.dns.disablePrefetch", True) # ff_prof.set_preference("network.dns.disablePrefetch", True)
# ff_prof.set_preference("network.http.sendRefererHeader", 0) # ff_prof.set_preference("network.http.sendRefererHeader", 0)
# ff_prof.set_preference("permissions.default.image", 2)
# ff_prof.set_preference("browser.download.folderList", 2)
# ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
# ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")
ff_prof.set_preference("permissions.default.image", 3)
ff_prof.set_preference("browser.download.folderList", 2)
ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")
ff_prof.set_preference('network.proxy.type', 1) ff_prof.set_preference('network.proxy.type', 1)
ff_prof.set_preference("network.proxy.socks_version", 5) ff_prof.set_preference("network.proxy.socks_version", 5)
ff_prof.set_preference('network.proxy.socks', '127.0.0.1') ff_prof.set_preference('network.proxy.socks', '127.0.0.1')


+ 3
- 19
MarketPlaces/DarkMatter/crawler_selenium.py View File

@ -32,7 +32,6 @@ baseURL = 'http://darkmat3kdxestusl437urshpsravq7oqb7t3m36u2l62vnmmldzdmid.onion
# Opens Tor Browser, crawls the website, then parses, then closes tor # Opens Tor Browser, crawls the website, then parses, then closes tor
#acts like the main method for the crawler, another function at the end of this code calls this function later #acts like the main method for the crawler, another function at the end of this code calls this function later
def startCrawling(): def startCrawling():
# opentor()
mktName = getMKTName() mktName = getMKTName()
driver = getAccess() driver = getAccess()
@ -42,25 +41,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(mktName, baseURL, True) new_parse(mktName, baseURL, True)
# Opens Tor Browser
#prompts for ENTER input to continue
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
#return: name of site in string type #return: name of site in string type
def getMKTName(): def getMKTName():
@ -77,7 +62,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
#@param: current selenium driver #@param: current selenium driver
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -94,7 +79,6 @@ def createFFDriver():
ff_binary = FirefoxBinary(config.get('TOR', 'firefox_binary_path')) ff_binary = FirefoxBinary(config.get('TOR', 'firefox_binary_path'))
ff_prof = FirefoxProfile(config.get('TOR', 'firefox_profile_path')) ff_prof = FirefoxProfile(config.get('TOR', 'firefox_profile_path'))
ff_prof.set_preference("places.history.enabled", False) ff_prof.set_preference("places.history.enabled", False)
ff_prof.set_preference("privacy.clearOnShutdown.offlineApps", True) ff_prof.set_preference("privacy.clearOnShutdown.offlineApps", True)
@ -105,7 +89,7 @@ def createFFDriver():
ff_prof.set_preference("network.cookie.lifetimePolicy", 2) ff_prof.set_preference("network.cookie.lifetimePolicy", 2)
#ff_prof.set_preference("network.dns.disablePrefetch", True)#connection issue #ff_prof.set_preference("network.dns.disablePrefetch", True)#connection issue
#ff_prof.set_preference("network.http.sendRefererHeader", 0)#connection issue #ff_prof.set_preference("network.http.sendRefererHeader", 0)#connection issue
ff_prof.set_preference("permissions.default.image", 1)
ff_prof.set_preference("permissions.default.image", 3)
ff_prof.set_preference("browser.download.folderList", 2) ff_prof.set_preference("browser.download.folderList", 2)
ff_prof.set_preference("browser.download.manager.showWhenStarting", False) ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain") ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")


+ 4
- 18
MarketPlaces/DarkTor/crawler_selenium.py View File

@ -31,7 +31,6 @@ baseURL = 'http://zuauw53dukqdmll5p3fld26ns2gepcyfmbofobjczdni6ecmkoitnfid.onion
# Opens Tor Browser, crawls the website, then parses, then closes tor # Opens Tor Browser, crawls the website, then parses, then closes tor
#acts like the main method for the crawler, another function at the end of this code calls this function later #acts like the main method for the crawler, another function at the end of this code calls this function later
def startCrawling(): def startCrawling():
# opentor()
mktName = getMKTName() mktName = getMKTName()
driver = getAccess() driver = getAccess()
@ -41,25 +40,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(mktName, baseURL, True) new_parse(mktName, baseURL, True)
# Opens Tor Browser
#prompts for ENTER input to continue
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
#return: name of site in string type #return: name of site in string type
def getMKTName(): def getMKTName():
@ -76,7 +61,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
#@param: current selenium driver #@param: current selenium driver
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -103,7 +88,7 @@ def createFFDriver():
ff_prof.set_preference("network.cookie.lifetimePolicy", 2) ff_prof.set_preference("network.cookie.lifetimePolicy", 2)
ff_prof.set_preference("network.dns.disablePrefetch", True) ff_prof.set_preference("network.dns.disablePrefetch", True)
ff_prof.set_preference("network.http.sendRefererHeader", 0) ff_prof.set_preference("network.http.sendRefererHeader", 0)
ff_prof.set_preference("permissions.default.image", 2)
ff_prof.set_preference("permissions.default.image", 3)
ff_prof.set_preference("browser.download.folderList", 2) ff_prof.set_preference("browser.download.folderList", 2)
ff_prof.set_preference("browser.download.manager.showWhenStarting", False) ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain") ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")
@ -145,6 +130,7 @@ def login(driver):
WebDriverWait(driver, 100).until(EC.visibility_of_element_located( WebDriverWait(driver, 100).until(EC.visibility_of_element_located(
(By.XPATH, "/html/body/div[1]/div/div/div[2]/main/div/div/section[5]/div/div[1]/div"))) (By.XPATH, "/html/body/div[1]/div/div/div[2]/main/div/div/section[5]/div/div[1]/div")))
# Saves the crawled html page, makes the directory path for html pages if not made # Saves the crawled html page, makes the directory path for html pages if not made
def savePage(driver, page, url): def savePage(driver, page, url):
cleanPage = cleanHTML(driver, page) cleanPage = cleanHTML(driver, page)


+ 2
- 16
MarketPlaces/DigitalThriftShop/crawler_selenium.py View File

@ -32,7 +32,6 @@ baseURL = 'http://kw4zlnfhxje7top26u57iosg55i7dzuljjcyswo2clgc3mdliviswwyd.onion
# Opens Tor Browser, crawls the website, then parses, then closes tor # Opens Tor Browser, crawls the website, then parses, then closes tor
#acts like the main method for the crawler, another function at the end of this code calls this function later #acts like the main method for the crawler, another function at the end of this code calls this function later
def startCrawling(): def startCrawling():
# opentor()
mktName = getMKTName() mktName = getMKTName()
driver = getAccess() driver = getAccess()
@ -42,24 +41,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(mktName, baseURL, True) new_parse(mktName, baseURL, True)
# Opens Tor Browser
#prompts for ENTER input to continue
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
#return: name of site in string type #return: name of site in string type
def getMKTName(): def getMKTName():
@ -76,7 +62,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
#@param: current selenium driver #@param: current selenium driver
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")


+ 6
- 20
MarketPlaces/HiddenMarket/crawler_selenium.py View File

@ -29,7 +29,6 @@ baseURL = 'http://mipx6eedtsvfgfcmbm3utjedgjez2w4dzjdrbhtd2mt3cicwhhzspxqd.onion
# Opens Tor Browser, crawls the website # Opens Tor Browser, crawls the website
def startCrawling(): def startCrawling():
# opentor()
marketName = getMKTName() marketName = getMKTName()
driver = getAccess() driver = getAccess()
@ -39,24 +38,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(marketName, baseURL, True) new_parse(marketName, baseURL, True)
# Opens Tor Browser
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Login using premade account credentials and do login captcha manually # Login using premade account credentials and do login captcha manually
def login(driver): def login(driver):
# wait for login page # wait for login page
@ -118,7 +104,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -145,10 +131,10 @@ def createFFDriver():
# ff_prof.set_preference("network.cookie.lifetimePolicy", 2) # ff_prof.set_preference("network.cookie.lifetimePolicy", 2)
# ff_prof.set_preference("network.dns.disablePrefetch", True) # ff_prof.set_preference("network.dns.disablePrefetch", True)
# ff_prof.set_preference("network.http.sendRefererHeader", 0) # ff_prof.set_preference("network.http.sendRefererHeader", 0)
# ff_prof.set_preference("permissions.default.image", 3)
# ff_prof.set_preference("browser.download.folderList", 2)
# ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
# ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")
ff_prof.set_preference("permissions.default.image", 3)
ff_prof.set_preference("browser.download.folderList", 2)
ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")
ff_prof.set_preference('network.proxy.type', 1) ff_prof.set_preference('network.proxy.type', 1)
ff_prof.set_preference("network.proxy.socks_version", 5) ff_prof.set_preference("network.proxy.socks_version", 5)
ff_prof.set_preference('network.proxy.socks', '127.0.0.1') ff_prof.set_preference('network.proxy.socks', '127.0.0.1')


+ 3
- 18
MarketPlaces/LionMarketplace/crawler_selenium.py View File

@ -31,7 +31,6 @@ baseURL = 'http://lionznqc2hg2wsp5vgruqait4cpknihwlje6hkjyi52lcl5ivyf7bcad.onion
# Opens Tor Browser, crawls the website, then parses, then closes tor # Opens Tor Browser, crawls the website, then parses, then closes tor
#acts like the main method for the crawler, another function at the end of this code calls this function later #acts like the main method for the crawler, another function at the end of this code calls this function later
def startCrawling(): def startCrawling():
# opentor()
mktName = getMKTName() mktName = getMKTName()
driver = getAccess() driver = getAccess()
@ -41,25 +40,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(mktName, baseURL, True) new_parse(mktName, baseURL, True)
# Opens Tor Browser
#prompts for ENTER input to continue
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
#return: name of site in string type #return: name of site in string type
def getMKTName(): def getMKTName():
@ -76,7 +61,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
#@param: current selenium driver #@param: current selenium driver
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -103,7 +88,7 @@ def createFFDriver():
ff_prof.set_preference("network.cookie.lifetimePolicy", 2) ff_prof.set_preference("network.cookie.lifetimePolicy", 2)
ff_prof.set_preference("network.dns.disablePrefetch", True) ff_prof.set_preference("network.dns.disablePrefetch", True)
ff_prof.set_preference("network.http.sendRefererHeader", 0) ff_prof.set_preference("network.http.sendRefererHeader", 0)
ff_prof.set_preference("permissions.default.image", 1)
ff_prof.set_preference("permissions.default.image", 3)
ff_prof.set_preference("browser.download.folderList", 2) ff_prof.set_preference("browser.download.folderList", 2)
ff_prof.set_preference("browser.download.manager.showWhenStarting", False) ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain") ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")


+ 3
- 18
MarketPlaces/M00nkeyMarket/crawler_selenium.py View File

@ -33,7 +33,6 @@ MARKET_NAME = 'M00nkeyMarket'
# Opens Tor Browser, crawls the website, then parses, then closes tor # Opens Tor Browser, crawls the website, then parses, then closes tor
#acts like the main method for the crawler, another function at the end of this code calls this function later #acts like the main method for the crawler, another function at the end of this code calls this function later
def startCrawling(): def startCrawling():
# opentor()
driver = getAccess() driver = getAccess()
if driver != 'down': if driver != 'down':
@ -42,25 +41,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(MARKET_NAME, BASE_URL, True) new_parse(MARKET_NAME, BASE_URL, True)
# Opens Tor Browser
#prompts for ENTER input to continue
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
#return: name of site in string type #return: name of site in string type
# def getMKTName(): # def getMKTName():
@ -77,7 +62,7 @@ def opentor():
# Closes Tor Browser # Closes Tor Browser
#@param: current selenium driver #@param: current selenium driver
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -104,7 +89,7 @@ def createFFDriver():
ff_prof.set_preference("network.cookie.lifetimePolicy", 2) ff_prof.set_preference("network.cookie.lifetimePolicy", 2)
ff_prof.set_preference("network.dns.disablePrefetch", True) ff_prof.set_preference("network.dns.disablePrefetch", True)
ff_prof.set_preference("network.http.sendRefererHeader", 0) ff_prof.set_preference("network.http.sendRefererHeader", 0)
ff_prof.set_preference("permissions.default.image", 1)
ff_prof.set_preference("permissions.default.image", 3)
ff_prof.set_preference("browser.download.folderList", 2) ff_prof.set_preference("browser.download.folderList", 2)
ff_prof.set_preference("browser.download.manager.showWhenStarting", False) ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain") ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")


+ 3
- 18
MarketPlaces/MetaVerseMarket/crawler_selenium.py View File

@ -33,7 +33,6 @@ baseURL = 'http://mdbvvcfwl3fpckiraucv7gio57yoslnhfjxzpoihf4fgdkdd7bwyv7id.onion
# Opens Tor Browser, crawls the website, then parses, then closes tor # Opens Tor Browser, crawls the website, then parses, then closes tor
#acts like the main method for the crawler, another function at the end of this code calls this function later #acts like the main method for the crawler, another function at the end of this code calls this function later
def startCrawling(): def startCrawling():
# opentor()
mktName = getMKTName() mktName = getMKTName()
driver = getAccess() driver = getAccess()
@ -43,25 +42,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(mktName, baseURL, True) new_parse(mktName, baseURL, True)
# Opens Tor Browser
#prompts for ENTER input to continue
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
#return: name of site in string type #return: name of site in string type
def getMKTName(): def getMKTName():
@ -78,7 +63,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
#@param: current selenium driver #@param: current selenium driver
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -105,7 +90,7 @@ def createFFDriver():
ff_prof.set_preference("network.cookie.lifetimePolicy", 2) ff_prof.set_preference("network.cookie.lifetimePolicy", 2)
ff_prof.set_preference("network.dns.disablePrefetch", True) ff_prof.set_preference("network.dns.disablePrefetch", True)
ff_prof.set_preference("network.http.sendRefererHeader", 0) ff_prof.set_preference("network.http.sendRefererHeader", 0)
ff_prof.set_preference("permissions.default.image", 1)##
ff_prof.set_preference("permissions.default.image", 3)
ff_prof.set_preference("browser.download.folderList", 2) ff_prof.set_preference("browser.download.folderList", 2)
ff_prof.set_preference("browser.download.manager.showWhenStarting", False) ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain") ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")


+ 4
- 18
MarketPlaces/MikesGrandStore/crawler_selenium.py View File

@ -31,7 +31,6 @@ baseURL = 'http://4yx2akutmkhwfgzlpdxiah7cknurw6vlddlq24fxa3r3ebophwgpvhyd.onion
# Opens Tor Browser, crawls the website, then parses, then closes tor # Opens Tor Browser, crawls the website, then parses, then closes tor
#acts like the main method for the crawler, another function at the end of this code calls this function later #acts like the main method for the crawler, another function at the end of this code calls this function later
def startCrawling(): def startCrawling():
# opentor()
mktName = getMKTName() mktName = getMKTName()
driver = getAccess() driver = getAccess()
@ -41,25 +40,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(mktName, baseURL, True) new_parse(mktName, baseURL, True)
# Opens Tor Browser
#prompts for ENTER input to continue
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
#return: name of site in string type #return: name of site in string type
def getMKTName(): def getMKTName():
@ -76,7 +61,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
#@param: current selenium driver #@param: current selenium driver
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -103,7 +88,7 @@ def createFFDriver():
ff_prof.set_preference("network.cookie.lifetimePolicy", 2) ff_prof.set_preference("network.cookie.lifetimePolicy", 2)
ff_prof.set_preference("network.dns.disablePrefetch", True) ff_prof.set_preference("network.dns.disablePrefetch", True)
ff_prof.set_preference("network.http.sendRefererHeader", 0) ff_prof.set_preference("network.http.sendRefererHeader", 0)
ff_prof.set_preference("permissions.default.image", 1)
ff_prof.set_preference("permissions.default.image", 3)
ff_prof.set_preference("browser.download.folderList", 2) ff_prof.set_preference("browser.download.folderList", 2)
ff_prof.set_preference("browser.download.manager.showWhenStarting", False) ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain") ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")
@ -145,6 +130,7 @@ def login(driver):
WebDriverWait(driver, 100).until(EC.visibility_of_element_located( WebDriverWait(driver, 100).until(EC.visibility_of_element_located(
(By.XPATH, "/html/body/div[1]/header/div/div[3]/div/div/ul/li[6]/a"))) (By.XPATH, "/html/body/div[1]/header/div/div[3]/div/div/ul/li[6]/a")))
# Saves the crawled html page, makes the directory path for html pages if not made # Saves the crawled html page, makes the directory path for html pages if not made
def savePage(driver, page, url): def savePage(driver, page, url):
cleanPage = cleanHTML(driver, page) cleanPage = cleanHTML(driver, page)


+ 4
- 16
MarketPlaces/Nexus/crawler_selenium.py View File

@ -31,7 +31,6 @@ baseURL = 'http://nexus2bmba34euohk3xo7og2zelkgbtc2p7rjsbxrjjknlecja2tdvyd.onion
# Opens Tor Browser, crawls the website, then parses, then closes tor # Opens Tor Browser, crawls the website, then parses, then closes tor
#acts like the main method for the crawler, another function at the end of this code calls this function later #acts like the main method for the crawler, another function at the end of this code calls this function later
def startCrawling(): def startCrawling():
# opentor()
mktName = getMKTName() mktName = getMKTName()
driver = getAccess() driver = getAccess()
@ -40,22 +39,10 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(mktName, baseURL, True) new_parse(mktName, baseURL, True)
# Opens Tor Browser
#prompts for ENTER input to continue
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
#return: name of site in string type #return: name of site in string type
@ -73,7 +60,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
#@param: current selenium driver #@param: current selenium driver
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -100,7 +87,7 @@ def createFFDriver():
ff_prof.set_preference("network.cookie.lifetimePolicy", 2) ff_prof.set_preference("network.cookie.lifetimePolicy", 2)
ff_prof.set_preference("network.dns.disablePrefetch", True) ff_prof.set_preference("network.dns.disablePrefetch", True)
ff_prof.set_preference("network.http.sendRefererHeader", 0) ff_prof.set_preference("network.http.sendRefererHeader", 0)
ff_prof.set_preference("permissions.default.image", 2)
ff_prof.set_preference("permissions.default.image", 3)
ff_prof.set_preference("browser.download.folderList", 2) ff_prof.set_preference("browser.download.folderList", 2)
ff_prof.set_preference("browser.download.manager.showWhenStarting", False) ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain") ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")
@ -133,6 +120,7 @@ def getAccess():
driver.close() driver.close()
return 'down' return 'down'
def savePage(driver, page, url): def savePage(driver, page, url):
cleanPage = cleanHTML(driver, page) cleanPage = cleanHTML(driver, page)
filePath = getFullPathName(url) filePath = getFullPathName(url)


+ 7
- 19
MarketPlaces/PabloEscobarMarket/crawler_selenium.py View File

@ -28,7 +28,6 @@ baseURL = 'http://niejmptjzwhlfywruoab4pbuxg7kp2mtcr4c6mgpeykju5matewg36yd.onion
# Opens Tor Browser, crawls the website # Opens Tor Browser, crawls the website
def startCrawling(): def startCrawling():
# opentor()
mktName = getMKTName() mktName = getMKTName()
driver = getAccess() driver = getAccess()
@ -38,24 +37,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(mktName, baseURL, True) new_parse(mktName, baseURL, True)
# Opens Tor Browser
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Login using premade account credentials and do login captcha manually # Login using premade account credentials and do login captcha manually
def login(driver): def login(driver):
input("Press ENTER when CAPTCHA is complete and login page has loaded\n") input("Press ENTER when CAPTCHA is complete and login page has loaded\n")
@ -89,7 +75,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -132,6 +118,8 @@ def createFFDriver():
driver = webdriver.Firefox(firefox_binary=ff_binary, firefox_profile=ff_prof, service=service) driver = webdriver.Firefox(firefox_binary=ff_binary, firefox_profile=ff_prof, service=service)
driver.maximize_window()
return driver return driver
@ -181,8 +169,8 @@ def getNameFromURL(url):
def getInterestedLinks(): def getInterestedLinks():
links = [] links = []
# hire hacker
links.append('http://niejmptjzwhlfywruoab4pbuxg7kp2mtcr4c6mgpeykju5matewg36yd.onion/?sub_id=36')
# # hire hacker
# links.append('http://niejmptjzwhlfywruoab4pbuxg7kp2mtcr4c6mgpeykju5matewg36yd.onion/?sub_id=36')
# hacker # hacker
links.append('http://niejmptjzwhlfywruoab4pbuxg7kp2mtcr4c6mgpeykju5matewg36yd.onion/?sub_id=34') links.append('http://niejmptjzwhlfywruoab4pbuxg7kp2mtcr4c6mgpeykju5matewg36yd.onion/?sub_id=34')
@ -221,7 +209,7 @@ def crawlForum(driver):
driver.back() driver.back()
# comment out # comment out
break
# break
# comment out # comment out
if count == 1: if count == 1:


+ 2
- 18
MarketPlaces/RobinhoodMarket/crawler_selenium.py View File

@ -29,9 +29,6 @@ baseURL = 'http://ilr3qzubfnx33vbhal7l5coo4ftqlkv2tboph4ujog5crz6m5ua2b2ad.onion
# Opens Tor Browser, crawls the website # Opens Tor Browser, crawls the website
def startCrawling(): def startCrawling():
# Opening tor beforehand gives "Tor exited during startup error"
# opentor()
marketName = getMKTName() marketName = getMKTName()
driver = getAccess() driver = getAccess()
@ -45,24 +42,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(marketName, baseURL, True) new_parse(marketName, baseURL, True)
# Opens Tor Browser
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Login is not needed in Robinhood # Login is not needed in Robinhood
def login(driver): def login(driver):
pass pass
@ -82,7 +66,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")


+ 3
- 18
MarketPlaces/ThiefWorld/crawler_selenium.py View File

@ -32,7 +32,6 @@ baseURL = 'http://qsw7iurcrdwyml5kg4oxbmtqrcnpxiag3iumdarefzeunnyc2dnyljad.onion
# Opens Tor Browser, crawls the website, then parses, then closes tor # Opens Tor Browser, crawls the website, then parses, then closes tor
#acts like the main method for the crawler, another function at the end of this code calls this function later #acts like the main method for the crawler, another function at the end of this code calls this function later
def startCrawling(): def startCrawling():
# opentor()
mktName = getMKTName() mktName = getMKTName()
driver = getAccess() driver = getAccess()
@ -42,25 +41,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(mktName, baseURL, True) new_parse(mktName, baseURL, True)
# Opens Tor Browser
#prompts for ENTER input to continue
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
#return: name of site in string type #return: name of site in string type
def getMKTName(): def getMKTName():
@ -77,7 +62,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
#@param: current selenium driver #@param: current selenium driver
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -104,7 +89,7 @@ def createFFDriver():
ff_prof.set_preference("network.cookie.lifetimePolicy", 2) ff_prof.set_preference("network.cookie.lifetimePolicy", 2)
ff_prof.set_preference("network.dns.disablePrefetch", True) ff_prof.set_preference("network.dns.disablePrefetch", True)
ff_prof.set_preference("network.http.sendRefererHeader", 0) ff_prof.set_preference("network.http.sendRefererHeader", 0)
ff_prof.set_preference("permissions.default.image", 1)
ff_prof.set_preference("permissions.default.image", 3)
ff_prof.set_preference("browser.download.folderList", 2) ff_prof.set_preference("browser.download.folderList", 2)
ff_prof.set_preference("browser.download.manager.showWhenStarting", False) ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain") ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")


+ 2
- 16
MarketPlaces/Tor2door/crawler_selenium.py View File

@ -29,7 +29,6 @@ baseURL = 'http://yzrrne3pveltulbavydr2kiashvlnysdwclwmklo6cyjuqpxi7ku4xqd.onion
# Opens Tor Browser, crawls the website # Opens Tor Browser, crawls the website
def startCrawling(): def startCrawling():
# opentor()
marketName = getMKTName() marketName = getMKTName()
driver = getAccess() driver = getAccess()
@ -39,24 +38,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(marketName, baseURL, True) new_parse(marketName, baseURL, True)
# Opens Tor Browser
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Login using premade account credentials and do login captcha manually # Login using premade account credentials and do login captcha manually
def login(driver): def login(driver):
#wait for login page #wait for login page
@ -118,7 +104,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")


+ 3
- 17
MarketPlaces/TorBay/crawler_selenium.py View File

@ -32,7 +32,6 @@ baseURL = 'http://torbay3253zck4ym5cbowwvrbfjjzruzthrx3np5y6owvifrnhy5ybid.onion
# Opens Tor Browser, crawls the website, then parses, then closes tor # Opens Tor Browser, crawls the website, then parses, then closes tor
#acts like the main method for the crawler, another function at the end of this code calls this function later #acts like the main method for the crawler, another function at the end of this code calls this function later
def startCrawling(): def startCrawling():
# opentor()
mktName = getMKTName() mktName = getMKTName()
driver = getAccess() driver = getAccess()
@ -42,25 +41,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(mktName, baseURL, True) new_parse(mktName, baseURL, True)
# Opens Tor Browser
#prompts for ENTER input to continue
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
#return: name of site in string type #return: name of site in string type
def getMKTName(): def getMKTName():
@ -77,7 +62,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
#@param: current selenium driver #@param: current selenium driver
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -124,6 +109,7 @@ def createFFDriver():
return driver return driver
#the driver 'gets' the url, attempting to get on the site, if it can't access return 'down' #the driver 'gets' the url, attempting to get on the site, if it can't access return 'down'
#return: return the selenium driver or string 'down' #return: return the selenium driver or string 'down'
def getAccess(): def getAccess():


+ 3
- 18
MarketPlaces/TorMarket/crawler_selenium.py View File

@ -31,7 +31,6 @@ baseURL = 'http://22222253ebafysmwyrl4uxfcs2xm6k7zb4xyse2csne73atvxu53gfad.onion
# Opens Tor Browser, crawls the website, then parses, then closes tor # Opens Tor Browser, crawls the website, then parses, then closes tor
#acts like the main method for the crawler, another function at the end of this code calls this function later #acts like the main method for the crawler, another function at the end of this code calls this function later
def startCrawling(): def startCrawling():
# opentor()
mktName = getMKTName() mktName = getMKTName()
driver = getAccess() driver = getAccess()
@ -40,25 +39,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(mktName, baseURL, True) new_parse(mktName, baseURL, True)
# Opens Tor Browser
#prompts for ENTER input to continue
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
#return: name of site in string type #return: name of site in string type
def getMKTName(): def getMKTName():
@ -75,7 +60,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
#@param: current selenium driver #@param: current selenium driver
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -102,7 +87,7 @@ def createFFDriver():
ff_prof.set_preference("network.cookie.lifetimePolicy", 2) ff_prof.set_preference("network.cookie.lifetimePolicy", 2)
# ff_prof.set_preference("network.dns.disablePrefetch", True) # ff_prof.set_preference("network.dns.disablePrefetch", True)
# ff_prof.set_preference("network.http.sendRefererHeader", 0) # ff_prof.set_preference("network.http.sendRefererHeader", 0)
ff_prof.set_preference("permissions.default.image", 1)
ff_prof.set_preference("permissions.default.image", 3)
ff_prof.set_preference("browser.download.folderList", 2) ff_prof.set_preference("browser.download.folderList", 2)
ff_prof.set_preference("browser.download.manager.showWhenStarting", False) ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain") ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")


+ 6
- 21
MarketPlaces/ViceCity/crawler_selenium.py View File

@ -32,7 +32,6 @@ baseURL = 'http://52qlucglu6fuaqist2herssakipapig2higaaayu7446n55xw4ylxqid.onion
# Opens Tor Browser, crawls the website, then parses, then closes tor # Opens Tor Browser, crawls the website, then parses, then closes tor
#acts like the main method for the crawler, another function at the end of this code calls this function later #acts like the main method for the crawler, another function at the end of this code calls this function later
def startCrawling(): def startCrawling():
# opentor()
mktName = getMKTName() mktName = getMKTName()
driver = getAccess() driver = getAccess()
@ -42,25 +41,11 @@ def startCrawling():
crawlForum(driver) crawlForum(driver)
except Exception as e: except Exception as e:
print(driver.current_url, e) print(driver.current_url, e)
closetor(driver)
closeDriver(driver)
new_parse(mktName, baseURL, True) new_parse(mktName, baseURL, True)
# Opens Tor Browser
#prompts for ENTER input to continue
def opentor():
from MarketPlaces.Initialization.markets_mining import config
global pid
print("Connecting Tor...")
pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
pid = pro.pid
time.sleep(7.5)
input('Tor Connected. Press ENTER to continue\n')
return
# Returns the name of the website # Returns the name of the website
#return: name of site in string type #return: name of site in string type
def getMKTName(): def getMKTName():
@ -77,7 +62,7 @@ def getFixedURL():
# Closes Tor Browser # Closes Tor Browser
#@param: current selenium driver #@param: current selenium driver
def closetor(driver):
def closeDriver(driver):
# global pid # global pid
# os.system("taskkill /pid " + str(pro.pid)) # os.system("taskkill /pid " + str(pro.pid))
# os.system("taskkill /t /f /im tor.exe") # os.system("taskkill /t /f /im tor.exe")
@ -104,10 +89,10 @@ def createFFDriver():
# ff_prof.set_preference("network.cookie.lifetimePolicy", 2) # ff_prof.set_preference("network.cookie.lifetimePolicy", 2)
# ff_prof.set_preference("network.dns.disablePrefetch", True) # ff_prof.set_preference("network.dns.disablePrefetch", True)
# ff_prof.set_preference("network.http.sendRefererHeader", 0) # ff_prof.set_preference("network.http.sendRefererHeader", 0)
# ff_prof.set_preference("permissions.default.image", 3)
# ff_prof.set_preference("browser.download.folderList", 2)
# ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
# ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")
ff_prof.set_preference("permissions.default.image", 3)
ff_prof.set_preference("browser.download.folderList", 2)
ff_prof.set_preference("browser.download.manager.showWhenStarting", False)
ff_prof.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")
ff_prof.set_preference('network.proxy.type', 1) ff_prof.set_preference('network.proxy.type', 1)
ff_prof.set_preference("network.proxy.socks_version", 5) ff_prof.set_preference("network.proxy.socks_version", 5)
ff_prof.set_preference('network.proxy.socks', '127.0.0.1') ff_prof.set_preference('network.proxy.socks', '127.0.0.1')


Loading…
Cancel
Save