Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

How To Check Whether An Html Element Or Plain Text Exists On A Page Or Not

curl

This topic has been archived. This means that you cannot reply to this topic.
No replies to this topic

#1 uniqueideaman

uniqueideaman

    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 52 posts

Posted 19 April 2017 - 05:41 PM

Pros,
 
 
Imagine you want to only provide your download link to those who tweet about you. Now, how would you code it ?
Let's make it simple for you to understand.
Let's say you want to write a php script that checks if a certain html element (eg. name=username) or plain text exists or not.
If it exists then to give you an alert "TRUE"; Else alert: FALSE.
 
In this example, you want the script to check this page:
 
And you want it to check if the following text (exact match) exists or not:
 "I'd like to put forward an Idea"
 
 How would you code it ? Can we see 2-3 examples ?
 I'd be grateful if you can show another example for a fuzzy match. Eg:
  * like to put forward *
  
 This is an interesting topic. Base the boolean around what exists or not on a page.
 Curious to see what the code would look like and php is capable of doing it in how many lines of code.
 
 
 Thanks