-
Notifications
You must be signed in to change notification settings - Fork 0
/
tempmail.py
35 lines (24 loc) · 988 Bytes
/
tempmail.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from selenium import webdriver
__author__ = "@subtosilencio on GitHub"
"""
MIT License
A short and simple permissive license with conditions only requiring preservation of
copyright and license notices. Licensed works, modifications, and larger works may
be distributed under different terms and without source code.
"""
class TempMailScrap:
def __init__(self):
self.driver = None
def load(self, firefox_binary_location, geckodriver_location = "./geckodriver"):
options = webdriver.FirefoxOptions()
options.headless = True
self.driver = webdriver.Firefox(options=options, executable_path=geckodriver_location)
def get_mail_list(self):
self.driver.get('https://temp-mail.org/en/change')
return self.driver.execute_script("return Mails.domains;")
def close(self):
try:
self.driver.close()
self.driver.quit()
except:
pass