多线程启动selenium,报NameError: name '__file__' is not defined

将__file__加上单引号就解决了:

  1.  
    # 获取当前文件名,用于创建模型及结果文件的目录
  2.  
    file_name = os.path.basename('__file__').split('.')[0]

参考网址:https://blog.csdn.net/m0_37544464/article/details/82906459

原文地址:https://www.cnblogs.com/jingzaixin/p/12012552.html