Python机器人行

2022-05-21 06:43:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用robobrowser进行一个项目。这个项目的目的是从某个网站上购买衣服。当我手动购买衣服时,网站要求电话确认(我收到一条包含我必须输入的代码的文本,这是一个iframe窗口),但当我尝试使用我的机器人时,购买失败,我没有收到任何文本消息。在确认购买之前,一切似乎都正常运转。我不明白机器人为什么不工作。一般来说,我对stackoverflow和编码都是新手,因为我刚上高中

<RoboForm utf8=✓, authenticity_token=3GhNS7PX9OrxDDJM919fy09aEWoCa+590JV+bPq9Xx9Ww0IWD1+c0Ggi8RnQgZsWq0HvKkB9xwyC+/NxzLQIXg==, order[billing_name]= , order[email]= , order[tel]= , order[billing_address]= , order[billing_address_2]=, order[billing_address_3]=, order[billing_city]= , order[billing_zip]= , order[billing_country]=GB, cardinal_order_no=0758f864-3045-447b-b1a4-bd0aec98244e, same_as_billing_address=1, store_credit_id=, store_address=[], credit_card[type]=visa, credit_card[cnb]= , credit_card[month]=12, credit_card[year]=2019, credit_card[ovv]= , order[terms]=0, order[terms]=[], hpcvv=, commit=process payment>

这是订单完成前的最后一张表格。下面是我的代码:

form = br.getform()
        form['order[billing_name]'] = "..."
        form['order[email]'] = "..."
        form['order[tel]'] = "..."
        form['order[billing_address]'] = "..."
        form['order[billing_city]'] = "..."
        form['order[billing_zip]'] = "..."
        form['order[billing_country]'].value = "..."
        form['credit_card[type]'].value = "..."
        form['credit_card[cnb]'] = "..."
        form['credit_card[month]'].value = "..."
        form['credit_card[year]'].value = "..."
        form['credit_card[ovv]'] = "..."
        form['order[terms]'].value = 1
br.submit_form(form)

Tags: 项目代码name文本formvalue网站address机器人ordercardcredittermsbilling衣服