Best Python code snippet using avocado_python
main.py
Source:main.py
...16 if connection:17 cursor = connection.cursor()18 match user_req:19 case '1':20 get_all_adds(cursor)21 case '2':22 user_name_to_search = input('ÐведиÑе Ð¸Ð¼Ñ Ð¿Ð¾Ð»ÑзоваÑелÑ, обÑÑÐ²Ð»ÐµÐ½Ð¸Ñ ÐºÐ¾ÑоÑого нÑжно найÑи.\n>>')23 get_adds_by_name(cursor, user_name_to_search.capitalize())24 case '3':25 user_min_num_to_search = input('ÐведиÑе минималÑнÑÑ ÑÑоимоÑÑÑ.\n>>')26 user_max_num_to_search = input(27 'ÐведиÑе макÑималÑнÑÑ ÑÑоимоÑÑÑ.\n>>')28 get_adds_by_limits(cursor, user_min_num_to_search, user_max_num_to_search)29 case '4':30 user_city_to_search = input('ÐведиÑе гоÑод, в коÑоÑом нÑжно найÑи обÑÑвлениÑ.\n>>')31 get_adds_by_city(cursor, user_city_to_search.capitalize())32 case '5':33 user_name_to_search = input('ÐведиÑе Ð¸Ð¼Ñ Ð¿Ð¾Ð»ÑзоваÑелÑ, по коÑоÑÐ¾Ð¼Ñ Ð½Ñжно найÑи инÑоÑмаÑиÑ.\n>>')34 user_max_num_to_search = input('ÐведиÑе макÑималÑнÑÑ ÑÑоимоÑÑÑ.\n>>')...
add_extractor.py
Source:add_extractor.py
...14 def extract_description(self):15 return self.tree.css('.info-container .description::text').get().strip()16 def extract_currency(self):17 return self.tree.css('.info-container .price::text').get().strip()18 def get_all_adds(self):19 return self.tree.css('.regular-ad').getall()20 def extract_number_of_beds(self):21 return self.tree.css('.rental-info .bedrooms::text').re_first(r'Beds:\s*(.*)')22class UtilsExtractor:23 def __init__(self, html):24 self.tree = Selector(html)25 def is_next_element_present(self):...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!