this is based on calsyslab project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.0 KiB

1 year ago
1 year ago
  1. __author__ = 'DarkWeb'
  2. '''
  3. Starting point of the Darkweb Mining Platform
  4. '''
  5. import os
  6. from datetime import *
  7. from MarketPlaces.DarkFox.crawler_selenium import crawler as crawlerDarkFox
  8. from MarketPlaces.Tor2door.crawler_selenium import crawler as crawlerTor2door
  9. import time
  10. # reads list of marketplaces
  11. def getMarkets():
  12. mkts = []
  13. with open('MarketsList.txt') as f:
  14. mkts = f.readlines()
  15. return mkts
  16. # Creates needed directories for marketplace if doesn't exist
  17. def createDirectory(mkt):
  18. # Package should already be there, holding crawler and parser
  19. pagesDir = '../' + mkt + '/HTML_Pages'
  20. # sharedFolderPath = r'\\VBoxSvr\VM_Files_(shared)'
  21. # pagesDir = os.path.join(sharedFolderPath, 'HTML/MarketPlaces/' + mkt + '/HTML_Pages')
  22. if not os.path.isdir(pagesDir):
  23. os.makedirs(pagesDir)
  24. currentDateDir = pagesDir + '/' + str("%02d" %date.today().month) + str("%02d" %date.today().day) + str("%04d" %date.today().year)
  25. if not os.path.isdir(currentDateDir):
  26. os.mkdir(currentDateDir)
  27. listingDir = currentDateDir + '/Listing'
  28. if not os.path.isdir(listingDir):
  29. os.mkdir(listingDir)
  30. listReadDir = listingDir + '/Read'
  31. if not os.path.isdir(listReadDir):
  32. os.mkdir(listReadDir)
  33. descriptionDir = currentDateDir + '/Description'
  34. if not os.path.isdir(descriptionDir):
  35. os.mkdir(descriptionDir)
  36. descReadDir = descriptionDir + '/Read'
  37. if not os.path.isdir(descReadDir):
  38. os.mkdir(descReadDir)
  39. if __name__ == '__main__':
  40. mktsList = getMarkets()
  41. for mkt in mktsList:
  42. mkt = mkt.replace('\n','')
  43. print("Creating listing and description directories ...")
  44. createDirectory(mkt)
  45. time.sleep(5)
  46. input("Directories created successfully. Press ENTER to continue\n")
  47. if mkt == "DarkFox":
  48. crawlerDarkFox()
  49. elif mkt == 'Tor2door':
  50. crawlerTor2door()
  51. print("Scraping process completed successfully!")