test.py 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. # import configparser
  2. # import os
  3. # config = configparser.ConfigParser()
  4. # # read config from conf/config.ini
  5. # def read_conf():
  6. # config.read(os.path.join("conf","config.ini"),encoding="utf-8")
  7. # if config.has_section('db'):
  8. # host = config['db']['host']
  9. # port = config['db']['port']
  10. # user = config['db']['user']
  11. # password = config['db']['password']
  12. # db = config['db']['db']
  13. # print(host, port, user, password, db)
  14. # return host, port, user, password, db
  15. # def write_conf():
  16. # # write config to conf/config.ini
  17. # config.add_section('db')
  18. # config.set('db', 'host', '122')
  19. # config.set('db', 'port', '333306')
  20. # config.write(open('conf/config.ini', 'w'))
  21. # read_conf()
  22. import re
  23. url = "https://h5.waimai.meituan.com/waimai/mindex/menu?mtShopId=1000088679487895&utm_source=&channel=default&source=shoplist&initialLat=39.940816&initialLng=116.444976&actualLat=39.940816&actualLng=116.444976"
  24. # get mtShopId
  25. mtShopId = re.findall(r"mtShopId=(\d+)", url)[0]
  26. print(mtShopId)