[問題] 透過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