Python Forum

Full Version: web parsing multi-classnames with selenium
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I had a program i wrote; maybe about a year ago. It uses selenium to login to Dollar General to auto clip digital coupons due to a lot of javascript on their site. They updated their site today and i noticed the program doesnt run as fluent as it did before.

My program used the div with classname "pod ci-gif recommended desktop " to identify unclipped coupons compared to clipped coupons. Note the space after in the class name. I figured out when i wrote the program that they added a space at the end. Not sure why but was required to find the correct class.

Now; after their site updated; i notice this space has changed again. However instead of consistently 1 single space after, it is now 2, or none. Which took me awhile to figure out what is going on with that. I took a screenshot at the point of looking at the source where the class name changes from now 2 spaces to no spaces at the end of the class name pod ci-gif recommended desktop

This isnt really a big issue, because the program still clips the coupons apperently (which is the time consuming part), and uses a different method to do that, but it used this class to identify and relay the number of coupons unclipped before running the program to determine if the program needs to be run at all or not.

I was just wondering if anyone saw something like this before? Im not even sure how i would introduce whitespace in the class name in CSS let alone why there is some class names with and without whitespace? I put a screenshot up for a viewable example
Parse some html using Selenium. It shows an error in case the class name contains spaces.

Here is the tag I'm searching for: <p class="p0 ng-binding">text</p>