I cannot figure out how to click "return" when I make Splinter library to input text into reddit's main search bar and since it has no button to search, I probably must click "return"
I saw a similar question here but it did not work for my case and also the case the person wrote the answer for.
class NavigationPage(object):
def __init__(self, br):
self.br = br
self.url = "http://reddit.com"
@property
def retrieve_reddit_search_bar(self):
"""
Retrieves search bar by it's name
"""
return self.br.find_by_name("q")
def search(self, search_term):
self.retrieve_reddit_search_bar.first.fill(search_term) # fills search bar
self.br.execute_script("document.getElementsByName('q')[0].submit()")
It fails with traceback during second statement in search method. If someone knows how to do it, can you also show me how to apply this "return" click business in all websites? I imagine they execute similar javascript to process search request.