1

I am building a movie subtitle downloading script. I am planning to download subtitles from www.isubtitles.net . i have titles of all movies in my pc in a list called namelist. so i plan to send movie names one by one in searchbox of the above site, search them and download subtitles from the first result shown. i use following code

homeurl="http://www.isubtitles.net"
for i in range (0, len(namelist)):
    browser.get(homeurl)
    searchele=browser.find_element_by_name("kwd")
    searchele.send_keys(namelist[i])  
    searchele.submit()

but python throws error "element not currently interactable and may not be manipulated" in line where we send keys. please look the website html and python code and tell what wrong i did. I am using phantomjs and not firefox for selenium.

1 Answer 1

2

You should wait for the search input to be visible with WebDriverWait:

wait = WebDriverWait(browser, 10)

for name in namelist:
    browser.get(homeurl)

    searchele = wait.until(EC.visibility_of_element_located((By.NAME, "kwd")))
    searchele.send_keys(name)
    searchele.submit()

Also note how I've improved your for loop - you don't have to loop over list indexes.

Sign up to request clarification or add additional context in comments.

2 Comments

now it is giving timeoutException. i also tried increasing the wait time but still error persists.
@dreadedHarvester interesting, that worked for me, I remember.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.