Automating Qibla Direction Calculation on a Website Using UiPath

Hi

I am currently working on a project where I need to automate the calculation of the qibla direction for various locations using a website. The website provides an interactive map and allows users to input their location to get the Qibla direction. I need to automate this process to extract Qibla directions for multiple locations efficiently.

Here’s a brief overview of the process I want to automate:

  1. Navigate to the Qibla website.
  2. Input a list of locations into the search field.
  3. Retrieve the Qibla direction results for each location.
  4. Export the results into a structured format (e.g., Excel or CSV).

I am familiar with the basics of UiPath, such as navigating web pages and extracting data, but I am encountering a few challenges:

  1. Inputting Multiple Locations: How can I automate the input of multiple locations from a predefined list (e.g., from an Excel sheet) into the website’s search field?
  2. Handling Dynamic Web Elements: The website uses dynamic elements to display the Qibla direction. What is the best approach to reliably extract this data using UiPath?
  3. Error Handling: Sometimes the website might not return a result for a particular location. How can I implement robust error handling to skip these cases and continue with the next location?
  4. Data Export: What is the most efficient way to compile and export the extracted Qibla direction data into an Excel or CSV file?

If anyone has experience with web automation in UiPath, especially with similar use cases, your guidance would be greatly appreciated. Sample workflows or snippets of code would be incredibly helpful.

Thank you in advance for your assistance!

Hello @adriancheofski!

It seems that you have trouble getting an answer to your question in the first 24 hours.
Let us give you a few hints and helpful links.

First, make sure you browsed through our Forum FAQ Beginner’s Guide. It will teach you what should be included in your topic.

You can check out some of our resources directly, see below:

  1. Always search first. It is the best way to quickly find your answer. Check out the image icon for that.
    Clicking the options button will let you set more specific topic search filters, i.e. only the ones with a solution.

  2. Topic that contains most common solutions with example project files can be found here.

  3. Read our official documentation where you can find a lot of information and instructions about each of our products:

  4. Watch the videos on our official YouTube channel for more visual tutorials.

Hopefully this will let you easily find the solution/information you need. Once you have it, we would be happy if you could share your findings here and mark it as a solution. This will help other users find it in the future.

Thank you for helping us build our UiPath Community!

Cheers from your friendly
Forum_Staff

While the topics you bring up are definitely important topics that you should look into for other UI automation projects, I wouldn’t do this particular one based on the website. It’s a simple trigonometric calculation you can perform yourself. Conceptually it’s as if you wanted to rely on a website to tell you how much 1+1 is instead of calculating it yourself. Why introduce the risk of the website breaking, when you can calculate it yourself? I know it’s a bit more complicated in reality, but really there isn’t a good reason IMO to rely on the website for doing this.

I simply googled the calculation to determine the direction in degrees. So you can implement a workflow that takes as input arguments your current location lat/long. And returns the direction as degrees as well as a compass direction (N/W/E/S/NW/NE/…) similar to the website. You can then call this workflow in a loop for all of your various locations. As for how to then write that data to Excel or CSV, you should be able to find that information easily on the forum or in the documentation. I’d loop over a data table and then write it out afterwards to the file.

Here is what that workflow would look like:


No guarantee that it’s correct, but testing with a few values yields the same results as your website. I’ve pushed the project here: chrikrah/uipathQiblaCalculator

Also as a side note here: My understanding is that the location of the Kaaba doesn’t change. So with a given input location, your output should always be the same. If you only have a limited amount of input locations, it might be easiest to just get the values by hand (e.g. from that website) and then use them as a static list.