提交 4b1fa562 作者: LiuLiYuan

Changes

上级 bdf0bc3e
import sys
import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from base import BaseCore
import pymysql
# social_code = '91440300665899831W'
# cn = pymysql.connect(host='114.115.159.144', user='root', password='zzsn9988', db='caiji', charset='utf8mb4')
# cursor = cn.cursor()
# sql = f"SELECT * FROM `EnterpriseInfo` WHERE SocialCode = '{social_code}'"
# cursor.execute(sql)
# data = cursor.fetchone()
# enname = data[5]
# gpdm = data[3]
# xydm = data[2]
# print(enname,gpdm,xydm)
# basecore =BaseCore.BaseCore()
# path = r'F:\spider\115\chromedriver.exe'
# driver = basecore.buildDriver(path,headless=False)
# url = 'https://www.baidu.com/'
# driver.get(url)
# time.sleep(10)
# driver.close()
# # service = Service(r'./chromedriver.exe')
# # executable_path = '.\\chromedriver.exe/'
# chrome_options = webdriver.ChromeOptions()
# # chrome_options.binary_location = r'./goole/Google/Chrome/Application/chrome.exe'
# # if headless:
# # chrome_options.add_argument('--headless')
# # chrome_options.add_argument('--disable-gpu')
# chrome_options.add_experimental_option(
# "excludeSwitches", ["enable-automation"])
# chrome_options.add_experimental_option('useAutomationExtension', False)
# chrome_options.add_argument('lang=zh-CN,zh,zh-TW,en-US,en')
# chrome_options.add_argument(
# 'user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36')
# driver = webdriver.Chrome(chrome_options=chrome_options, executable_path=executable_path)
# driver.get('www.baidu.com')
# time.sleep(10)
# driver.close()
# def a():
# return ''
# xxx = a()
# if xxx == '':
# print('xxx')
def a():
print('a....1')
for i in range(2):
if i == 1:
print('a....3')
sys.exit(0)
print('a....4')
print('a....2')
def b():
print('b....1')
pass
if __name__ == '__main__':
print('a....start')
a()
print('b....start')
b()
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论