I got some troubles when scraping the questions and answers from websites:
The problem is the answer only appear when I click on a div Xem đáp án (scroll down to the end) but it’s not a link, it just a div, I guess it use Javascript event trigger to render content after the click on div.
How can I deal with this with Beautifulsoup. I got confict driver problem with Selenium when I use on Ubuntu.
Thank you
2
Answers
I finally solved this issue!
I couldn't run the driver due to a conflict between the chrome app version and the chrome-driver version (the one located in
usr/local/bin
).I found this repository containing my chrome app version: https://github.com/dreamshao/chromedriver
I download the suitable version for me and put in the
usr/local/bin
folder.You shouldn’t need to explicitly download a Chrome driver. Modern selenium versions handle it for you.
Hence, all you need is this:
Output (partial):