import time
from rk import RClient
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from urllib.request import urlretrieve
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.keys import Keys
class Gx(object):
def __init__(self):
self.bse_url = 'http://www.gsxt.gov.cn/index.html'
self.driver = webdriver.Firefox()
def run(self):
self.driver.get(self.bse_url)
time.sleep(2)
qw = WebDriverWait(self.driver, 30).until(lambda driver: driver.find_element_by_id('keyword'))
qw.send_keys('阿里巴巴')
time.sleep(2)
qw.send_keys(Keys.ENTER)
s = WebDriverWait(self.driver, 30).until(lambda driver: driver.find_element_by_class_name('geetest_item_img'))
print(s)
time.sleep(1)
src = s.get_attribute('src')
print(src)
urlretrieve(src, 'ma
selenium国家信息公示网
最新推荐文章于 2024-07-03 07:40:31 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)