有没有这样做的图书馆?
这是我想要实现的一个例子:
data = """
<form action='/'>
<input type='text' name='test'>
</form>
"""
x = buildformdata(data)
print(x)
{'test': ''}
我知道如何使用ex来创建它。 beautifulsoup,但也许已经做了一些事情?例如,如何转换Firefox或Chrome用于将数据构建到python中的代码?
这是执行此操作的一些代码:
https://github.com/jmcarp/robobrowser/blob/master/robobrowser/forms/fields.py
https://github.com/jmcarp/robobrowser/blob/master/robobrowser/forms/form.py#L64