Klasse SearchAction

java.lang.Object
eu.hobbydev.bracheus.actions.SearchAction
Alle implementierten Schnittstellen:
Actions, HumanizerTools
Bekannte direkte Unterklassen:
UpdateUserAction

public class SearchAction extends Object implements Actions, HumanizerTools
Represents an action that performs a search operation on Instagram. The action attempts to search for a user profile by navigating through the platform's UI, utilizing both elements like the profile span and the search input field. If any element is not found, the class attempts a direct search and handles login actions if necessary. This class implements the `Actions` interface, which likely defines the `handleAction()` method to perform the action when invoked. It also implements the `HumanizerTools` interface, which may provide additional utility methods for simulating human-like interactions (e.g., adding delays).
  • Konstruktordetails

    • SearchAction

      public SearchAction(String user)
      Constructs a SearchAction with the specified username to search for.
      Parameter:
      user - the username to search for on Instagram
  • Methodendetails

    • handleAction

      public void handleAction()
      Executes the search action by performing a sequence of steps: - Checks if the profile span is present to ensure the user is logged in. - If not, attempts to log in by registering a LoginAction. - Starts the search process either via the search span or by performing a direct search. This method handles errors by retrying or invoking alternative methods if elements are not found.
      Angegeben von:
      handleAction in Schnittstelle Actions
    • directSearch

      protected void directSearch()
      Placeholder method for performing a direct search if elements cannot be found. This method currently does not implement any specific functionality but can be extended.
    • getName

      public String getName()
      Gets the name of this action, used for logging and identification purposes.
      Angegeben von:
      getName in Schnittstelle Actions
      Gibt zurück:
      the name of the action, "SearchAction"