【问题标题】:loop the function of html parser循环html解析器的功能
【发布时间】:2014-05-05 13:28:14
【问题描述】:

我想循环查找文件名 1,2,3,我可以在脚本中运行它。但是,我想在这里做 for 循环:

eval('!html_parser.py 1');
eval('!html_parser.py 2');
eval('!html_parser.py 3');

我得到了这个错误:

for i = 1:3

eval('!html_parser.py',strcat(int2str(i)));

end

html_parser.py

from optparse import OptionParser
p = optparse.OptionParser('%prog')
(options, args) = p.parse_args()

folder_count = args[2]

driver = webdriver.Firefox()

pattern = "*.*htm*"

captured_text = ''

【问题讨论】:

    标签: python python-2.7 matlab matlab-figure


    【解决方案1】:

    如果您需要在第一次剪辑时构建不同的字符串,您可能需要考虑这个

    for i = 1:3
    
       eval([ '!html_parser.py ', num2str(i) ]);
    
    end
    

    这里的字符串是通过(隐式)连接两个字符串来构建的。

    【讨论】:

    • 我得到这样的错误“html_parser.py1' is not known as an internal or external command, operable program or batch file.”
    • @user3340270,我忘记了 '.py' 后面的空格。现在应该是正确的。
    猜你喜欢
    • 2018-03-05
    • 1970-01-01
    • 2015-06-21
    • 2015-07-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-14
    • 1970-01-01
    相关资源
    最近更新 更多