Here is my code snippet that relates to this issue
def process_project(driver):
text_box_xpath = "//*[@id='descriptionTextArea']"
try:
# Check if text box xpath is found
text_box_element = driver.find_element(By.XPATH, text_box_xpath)
print("Text box found.")
Here is the URL of any random project “
https://www.freelancer.com/projects/laravel/Laravel-VueJs-Integration-Experts-Needed/
” (please check this and more projects after login with the freelancer website)
I have one issue this the xpath “`
//*[@id="descriptionTextArea"]`
” where I want to submit my proposal but this xpath is visible in both types of projects, even the freelancer also not displaying any textbox here so there I can submit my proposal for many reason such as not verified my account or NDA sign etc but when I search this xpath in inspect element on the same project so this xpath also found there although there is no any textbox visible there to bid and I want to filter the projects that display me the textbox so my automation bot submit Enter on that area and paste my proposal otherwise it should return to the previous page by (
driver.back()
), but this xpath is available in both type of project, so what I do now?
I am giving you the full xpath of both type projects , pics and mention as well which project showing me option to submit the proposal along displaying the textbox too and which one is not showing the option to submit the proposal but still if we search in inpect element this xpath will be available already therefore, My bot cant difference in both type of projects. I am giving you the full xpath of both type of projects along the Html element of this teaxarea so you can also check the same path is available in both type of projects, please help me, How do i filter this?
Here is the fullxpath and element which showing me the textarea to enter my proposal
fullxpath ” `
/html/body/app-root/app-logged-in-shell/div/fl-container/div/div/app-project-view/app-project-view-logged-in/app-project-view-details/fl-page-layout/main/fl-container/fl-page-layout-single/fl-grid/fl-col[1]/app-project-details-freelancer/app-bid-form/fl-card/div/div[2]/fl-bit[1]/fl-textarea/textarea`
”
Html element “`
<textarea _ngcontent-webapp-c175="" flcontrolvalueaccessor="" class="TextArea ng-tns-c175-175 ng-trigger ng-trigger-shakeAnimation ng-untouched ng-pristine ng-invalid" aria-errormessage="textarea-undefined-errorId-iq12" aria-invalid="false" data-auto-grow="true" data-font-color="dark" data-size="xsmall" data-weight="normal" id="descriptionTextArea" data-borderless="false" placeholder="What makes you the best candidate for this project?" data-resize="vertical" data-hide-scrollbar="false" rows="4" autocomplete="off" spellcheck="false" style="overflow: auto; height: 110px;"></textarea>`
“
and here is is the fullxpath and HTML element of textarea that is not available in frontend page but if search this xpath in it inpect element this xpath will be still available
fullxpath”`
/html/body/app-root/app-logged-in-shell/div/fl-container/div/div/app-project-view/app-project-view-logged-in/app-project-view-details/fl-page-layout/main/fl-container/fl-page-layout-single/fl-grid/fl-col[1]/app-project-details-freelancer/app-bid-form/fl-card/div/div[2]/fl-bit[1]/fl-textarea/textarea`
”
Html element “`
<textarea _ngcontent-webapp-c195="" flcontrolvalueaccessor="" class="TextArea ng-tns-c195-93 ng-trigger ng-trigger-shakeAnimation ng-untouched ng-pristine ng-invalid" aria-errormessage="textarea-undefined-errorId-o7jr" aria-invalid="false" data-auto-grow="true" data-font-color="dark" data-size="xsmall" data-weight="normal" id="descriptionTextArea" data-borderless="false" placeholder="What makes you the best candidate for this project?" data-resize="vertical" data-hide-scrollbar="false" rows="4" autocomplete="off"></textarea>`
”
I want to find this textarea, If my bot find this so it will do next steps otherwise it will simply do
`driver.back()`
But when I try to get to reach any xpath of this area and run my bot so my bot also find same XPath here as well although there is no any option displaying to bid on this project , I don’t know why and how to handle this, see this in the picture there is no option to bid on this project but every XPath from above picture I use in my code, but every XPath of the any element I use all xpath bot find too in unbid able project as well.
I have checked many xpath but all available in not bid able project as well
Sajjad curiosity is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.