Webscraping and filling in input fields [solved] | Sololearn: Learn to code for FREE!


Webscraping and filling in input fields [solved]

Dear Community, I am trying to scrape the search results of the webpage www.chembid.com after filling in a value into the search field. I tried it in two different ways, but both fail. See the code here: https://code.sololearn.com/cA114a4A22a2 Would be great if anybody could tell me what I have to correct in order to make it work. Note: the code does not work in the playground as the libs are missing. Thanks in advance!

2/8/2021 4:42:23 PM


2 Answers

New Answer


1. You're scrapping from the wrong url 2. Before you make a beautifulsoup object, you must first open the result link, parse them as a string. In this case I've used the urllib instead of requests and now have beautifulSoup installed. 3. you can now work with the web source code as a beautifulSoup object using the output of my code. I searched for ethanol as a test case https://code.sololearn.com/cVuZj7OJ83Rb/?ref=app


Thanks a lot!