-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: 🐛 Hotfix. Change selectors due to new html structure #905
fix: 🐛 Hotfix. Change selectors due to new html structure #905
Conversation
udpate v3.1.0 with Release/v11.15.2024
repalced union with base class.
Integration with AI/ML API
Add GroqAIModel support
Some providers (as OpenAI) support reducing cost of calls by caching repetitive content, but the feature works only with the initial portion (prefix) of prompts
included links to AI/ML API docs and the endpoint to be used in the code.
Add AI/ML API info
…-caching perf: ⚡ Optimize prompt for better caching
(cherry picked from commit 6b23715)
(cherry picked from commit c75f78f)
bc83944
to
a603455
Compare
Sorry, I supposed to begin branch name with "hotfix" instead of "bug" |
Currently, only the selectors that I have changed have been tested for changes on LinkedIn side. There might be more |
@chakaponi released hotfix, I just applied - automation didn't break. can you explain on impact on description |
@surapuramakhil Discord's having auth problems so I can't use it. Only telegram |
@chakaponi not able to find you. can you ping me on telegram |
thread link for sharing your jobs view structure, for having a fix which works for all. https://discord.com/channels/1300208460788400159/1310293395226230896 run this command on dev tools console
you can run copy($('#main')) in your chrome dev tools on, for example, this page: https://www.linkedin.com/jobs/search/?currentJobId=4042558197&distance=10&f_E=4&f_LF=f_AL&f_WT=2&keywords=JavaScript%20Developer&location=Mexico It will copy element which contain currently open job and block with list of jobs (left sidebar) |
Current solution is fine for hotfix, but not as constant
@chakaponi can you test hotfix branch? and see if this required |
@chakaponi hello, if it is no longer useful remove it with no problem! |
@surapuramakhil Hotfix branch has been merged into mine with some changes and rewritten tests. All tests pass. Works in normal environment for me. |
@chakaponi can you comment on #927 #926 so that I can assign those to you. |
Hi guys, I git clone the hotfix/v2024.11.23, but still does not work. |
65f8ac9
into
AIHawk-FOSS:hotfix/v2024.11.23
@chakaponi Next time don't force push. It corrupts subsequent processes. |
Thank you for your effort @surapuramakhil , may I ask if the issue has fixed?
|
just update your main. git fetch
git pull if you face errors then clone again. |
jobs_container = self.driver.find_element(By.CLASS_NAME, 'scaffold-layout__list-container') | ||
# XPath query to find the ul tag with class scaffold-layout__list-container | ||
jobs_xpath_query = "//ul[contains(@class, 'scaffold-layout__list-container')]" | ||
jobs_container = self.driver.find_element(By.XPATH, jobs_xpath_query) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They unlikely will keep this class with not ul tag so both approaches are equal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some bad approaches is choosen. Needs partial revert
Please notice me after revert so I will be able to be sure that we are getting working approach
@@ -262,7 +264,7 @@ def get_jobs_from_page(self, scroll=False): | |||
browser_utils.scroll_slow(self.driver, jobs_container_scrolableElement) | |||
browser_utils.scroll_slow(self.driver, jobs_container_scrolableElement, step=300, reverse=True) | |||
|
|||
job_element_list = jobs_container.find_elements(By.CSS_SELECTOR, 'div[data-job-id]') | |||
job_element_list = jobs_container.find_elements(By.XPATH, ".//li[contains(@class, 'jobs-search-results__list-item') and contains(@class, 'ember-view')]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say that rely on "ember-view" instead of "data-job-id" more likely to cause problems again so I would revert this change
@@ -483,7 +473,7 @@ def job_tile_to_job(self, job_tile) -> Job: | |||
logger.warning("Job link is missing.") | |||
|
|||
try: | |||
job.company = job_tile.find_element(By.XPATH, './/span[contains(normalize-space(), " · ")]').text.split(' · ')[0].strip() | |||
job.company = job_tile.find_element(By.XPATH, ".//div[contains(@class, 'artdeco-entity-lockup__subtitle')]//span").text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not robust. Also advise to revert
@@ -500,15 +490,21 @@ def job_tile_to_job(self, job_tile) -> Job: | |||
logger.warning(f"Failed to extract job ID: {e}", exc_info=True) | |||
|
|||
try: | |||
job.location = job_tile.find_element(By.XPATH, './/span[contains(normalize-space(), " · ")]').text.split(' · ')[-1].strip() | |||
job.location = job_tile.find_element(By.CLASS_NAME, 'job-card-container__metadata-item').text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simply doesn't work. If we check, 'job-card-container__metadata-item' never follow as to location, but to salary fork. Has to be reverted with no doubt
try: | ||
job.apply_method = job_tile.find_element(By.XPATH, ".//div[contains(@class, 'job-card-container__job-insight-text') and normalize-space() = 'Easy Apply']").text | ||
job_state = job_tile.find_element(By.XPATH, ".//ul[contains(@class, 'job-card-list__footer-wrapper')]//li[contains(@class, 'job-card-container__apply-method')]").text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't work. Return empty array all of the time. Revert
@surapuramakhil If you want to keep your approach, you can rewrite code a little and keep both so if one class returns an empty array we could try other one right after |
My Apologies @chakaponi as this was breaking change, I took decision for "quicker release, for pushing fix which at least work, than no fix at all".
|
Thank you for your great work on this. @surapuramakhil and @chakaponi |
Don't get it. My fix was ready and tested so why wouldn't have used it |
Main branch may work if you are lucky enough. If not, try this branch, but with reverted commit with hash 22f2c3b |
created a poll to see if the main branch works or not. #919 (comment) |
@chakaponi I have created the hotfix branch. Please raise a PR to the hotfix branch. |
…nt-selectors fix: 🐛 Hotfix. Change selectors due to new html structure Co-authored-by: chakaponi <[email protected]>
LinkedIn has changed their HTML structure therefore app stopped to apply to jobs