Uploading A File To Shopify With Selenium And Python
I am having difficulty uploading files to shopify using selenium .. Selenium can't seem to find the input element I need to add my file to, I'm assuming it's to do with the input type=hidden part? See image.
I have tried a bunch of variations like this
WebDriverWait(browser, 10).until(EC.element_to_be_clickable((By.XPATH, "//input[@id='files_']"))).send_keys("DIR/myfile.pdf')
and tried to execute a scrip to try unhide the input
container = browser.find_element_by_xpath("//input[@type='hidden']") browser.execute_script("arguments.type = 'text';", container)
The documentations for shopifyapi aren't the greatest, and I'm not the best coder. Any help woul dbe apprecitated. Thanks!
To upload file you have to send keys to the
input with type
file, generally it hidden. Replace
presence_of_element_located and try to send keys like in code below:
WebDriverWait(browser, 10).until(EC.presence_of_element_located((By.CSS_SELECTOR, "input#files_"))).send_keys("DIR/myfile.pdf')
- → What are the pluses/minuses of different ways to configure GPIOs on the Beaglebone Black?
- → Django, code inside <script> tag doesn't work in a template
- → React - Django webpack config with dynamic 'output'
- → GAE Python app - Does URL matter for SEO?
- → Put a Rendered Django Template in Json along with some other items
- → session disappears when request is sent from fetch
- → Python Shopify API output formatted datetime string in django template
- → Shopify app: adding a new shipping address via webhook
- → Shopify + Python library: how to create new shipping address
- → shopify python api: how do add new assets to published theme?
- → Access 'HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT' with Python Shopify Module