case this would be undergraduate like that so if we run this it should still work we get the value undergraduate now if we change this and we remove the e notice that obviously it's not going to give it to us because that no longer matches so pretty straightforward if you want to look for an attribute just put the name of the attribute equals and then whatever it is that you're looking for if you want to look for text you can look for text like this and if you want to look for multiple tag names you can put them inside of a list so before we continue i do need to thank the sponsor of this video and the series which is algo expert algo expert is the best platform to use from preparing for your software engineering coding interviews they have a ton of practice questions mock interviews a data structures crash course and a lot of other awesome features check them out today from the link in the description and use the code tech with tim for a discount on the platform now next i'm going to show you how we can look for different class names so this one is actually very useful uh to be able to do a lot of times you want to look for a class that is placed on some of these elements so maybe we're looking for button item or something like that now what you would think you would do right would you you just write class equals but the problem with this is that class is a reserved keyword in python that is used for actually creating a class so instead of writing class you just do class underscore and now you can search for the class name of specific items so let's remove all of this and let's find all of the classes that have btn hyphen item or all of the tags that have btn item as one of their classes so now you're going to see that we get this a tag i guess we get another a tag regardless you get the point that is how you search for a class name now lastly i will show you how we can use a regular expression so the regular expression module in python is called re so if you import re what you can actually do now is you can look or use a regular expression for any of these things that you're searching for so let's say we want to find some text so let's go text is equal to and we want this text to contain a dollar sign but we actually want to get what the text is after the dollar sign as well so the same example we had done previously right we wanted to find the price of an item and what we did is we found the dollar sign and then we had to do a bit of work and find the parent tag and then we looked for another tag inside of that and then we found the text inside of that tag and well that was a lot of work and the reason we had to do that is because we could only find just the dollar sign we didn't know what the price was going to be whereas here we can use a regular expression that will actually give us all of the text that is beside to the left or right of a dollar sign so if you look here notice i have two things that have dollar signs so NUMBER_TOKEN NUMBER_TOKEN NUMBER_TOKEN NUMBER_TOKEN NUMBER_TOKEN NUMBER_TOKEN NUMBER_TOKEN i just threw them in the document here and now what i can do is look for text and i can say re dot compile this is how you write a regular expression you put it inside of dot compile
START_SPONSOR_TOKEN continue i do need to thank the sponsor of this video and the series which is algo expert algo expert is the best platform to use from preparing for your software engineering coding interviews they have a ton of practice questions mock interviews a data structures crash course and a lot of other awesome features check them out today from the link in the description and use the code tech with tim for a discount on END_SPONSOR_TOKEN