1
この障害を乗り越えるにはちょっと迷っています。私はKijijiの代理人をつくろうとしています。Macにいるときにファイルのアップロードを処理する方法については固執しています。私はSeleniumの画像/ファイルアップロード
driver.find_element_by_id('ImageUploadButton').send_keys(image)
を実行しようとしました。しかしそれは、私はそれが理由Kijijiはの特別なファイルアップロードのかもしれないと信じて、何もしていないようですが、私はこのハードルを乗り越えるするかどうかはわかりません。
誰もこれまでに行ったことはありますか?
彼らの「ソースの表示」ページのコード:あなたが代わりにボタンの「ファイル」input
要素ターゲットにする必要がある
<div id="ImageUpload" class="clearfix form-section placeholders">
<p class="images-title">Add at least one photo. Use more to show different angles and details.</p>
<ol id="UploadedImages">
</ol>
<span class="field-message" data-for="FileUploadInput"></span>
<div id="ImageDragAndDrop" class="clearfix">
<div class="image"></div>
<div class="copy">
<h3>Drag and Drop</h3>
<p>Drag and drop to change the order of your pictures.</p>
</div>
</div>
<div id="FileInputWrapper" class="file-input-wrapper">
<input type="hidden" name="file" id="FileUploadInput" >
<h3>Get at least twice the number of replies by uploading images</h3>
<p>You can upload a maximum of <span id="MaxImages">10</span> photos, that are at least 300px wide or tall (we recommend at least 1000px).</p>
<button id="ImageUploadButton" type="button" class="button-update-cancel short file-upload-button">
Select Images</button>
</div>
<input type="hidden" name="images">
</div>
は 'ファイル入力要素 – Andersson
用HTML'コードを提供するここでのスクリーンショットです。 http://imgur.com/a/BRueF –
'button'型の要素にテキストを送ることはできません。ページの '要素を確認してください – Andersson