[问题] 透过Selenium/Restful上传图片卡关

楼主: sulaxd (SulaXD)   2016-07-01 15:36:26
最近想写一个Yahoo拍卖的自动上架程式,透过Selenium。
一切都很顺利,但在图片上传的时候卡关了,如图:
[img]http://andrew.ga/TMP/y1.png[/img]
很合理,因为会开启原生的档案浏览器:
[img]http://andrew.ga/TMP/y2.png[/img]
下图为该Btn及input file对应的原始码:
[img]http://andrew.ga/TMP/y3.png[/img]
这部分我有尝试用Selenium直接sendKeyValue到input file,但无法送。
于是,我从Restful API方面下手:
Request URL:https://tw.bid.yahoo.com/partner/image_upload
Request Method:POST
Accept:*/*
Accept-Encoding:gzip, deflate, br
Accept-Language:zh-TW,zh;q=0.8,en-US;q=0.6,en;q=0.4,zh-CN;q=0.2,th;q=0.2,ja;q=0.2
Connection:keep-alive
Content-Length:720067
Content-Type:multipart/form-data; boundary=

Links booklink

Contact Us: admin [ a t ] ucptt.com