zubyj / leetcode-explained

Browser extension that adds video solutions, company tags, and GPT code analysis into Leetcode problems
https://leetcodeapp.com
MIT License
86 stars 13 forks source link

Find out how to retrieve 'Solutions' tab using class or id name rather than CSS selectors (bad practice) #3

Closed zubyj closed 1 year ago

zubyj commented 1 year ago

I'm using the css selectors to get the 'Solutions' tab. I dont know how else to do it. I cant find the classnames :[

const solutionsTab = document.querySelectorAll('div.w-full.flex-col.overflow-auto')[1];

zubyj commented 1 year ago

The problem isnt grabbing the solutions tab. Its grabbing the solution window. It doesnt have any values or unique classname or id's. So really the only way to select it is from its css. This is going to break the app when the css code is changed on leetcode. But whatever ill worry about it then.