admin 管理员组

文章数量: 1184232


2024年1月6日发(作者:dz论坛辅助模板)

inputElement[0].send_keys(url) # search url in search box searchButton[0].click() # click the corresponding button browser_res = _source# print(browser_res) soup = BeautifulSoup(browser_res,"") # ,from_encoding="utf-8") link_node = ('a',href=e(r"ipv4")) # print (link_,link_node['href'],link__text()) return link__text() if link_node != None else None # get the ip of the url

def github_hosts(self, get_type=0): """ get_type: the way we use to get ip, get_type=0:request(default) | get_type=1:selenium """ success_hosts = {} failure_hosts = {}

for url in : host_url = ().split('/')[-1] host_url = host_url if host_url != '' else '' try: # print(host) ip = _req(url) if get_type==0 else _sel(host_url)

print(ip, host_url) if ip == None: failure_hosts[host_url] = ip # sometimes different host has the same ip else: success_hosts[host_url] = ip

if get_type == 1:

(0.7) () except Exception as err: failure_hosts[host_url] = None print(err) print('------------------------------------------------') print('faiure_hosts:n', failure_hosts) print('------------------------------------------------') print('success_hosts:') for k, v in success_(): print(v, k) print('------------------------------------------------')

if __name__ == '__main__':

ip_obj = GetIP() ip__hosts(get_type=0)


本文标签: 辅助 论坛 作者 模板