File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
backend/apps/datasource/api Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1010from selenium .webdriver .support .ui import WebDriverWait
1111
1212from common .core .deps import SessionDep
13+ from selenium .webdriver .chrome .options import Options
14+ from selenium .webdriver .chrome .service import Service
1315
1416router = APIRouter (tags = ["export" ], prefix = "/export" )
1517
1618
1719@router .get ("/png" )
1820async def export (session : SessionDep ):
19- driver = webdriver .Chrome () # 或者使用webdriver.Firefox()等
21+
22+
23+ options = Options ()
24+ options .add_argument ("--headless" )
25+ service = Service (executable_path = '/root/sqlbot/chromedriver-linux64/chromedriver' )
26+ driver = webdriver .Chrome (service = service , options = options ) # 或者使用webdriver.Firefox()等
2027 print ('init done' )
2128 # 打开网页
2229 driver .get ('https://g2.antv.antgroup.com/examples/general/interval/#bar-basic' )
You can’t perform that action at this time.
0 commit comments