wanni
3 years agoOccasional Contributor
Imports of unsupported third-party modules
Import using sys_path,there is no problem with the first execution, and the second execution will still report an error, lxml import.
import sys sys.path.insert(0, r"C:\Program Files (x86)\SmartBear\TestComplete 15\x64\Bin\Extensions\Python\Python38\Lib") from lxml import etree def aa(): #获取本地的html文件,parse() html = etree.parse(r"D:\fsdata\cyptube2017\machine.config") result = html.xpath("//MachineConfig/TripRecord/@LubricateTripX") Log.Message(result[0]) |