How to export words from website with coordinates?

Peter Gawęda

Peter Gawęda

• 4 min reading
How to export words from website with coordinates?

Our API offers a straightforward solution for extracting precise information such as word coordinates and CSS properties from web pages

In certain scenarios, the necessity arises to extract precise information such as coordinates and CSS properties for each word on a web page.

Our API offers a straightforward solution, allowing users to seamlessly retrieve this information through HTTP requests.

Extracting Words with Coordinates: A Step-by-Step Guide

  • Input the website URL: Create a well-formed HTTP request where you input the target URL of the website from which you want to use extraction functionality to extract word coordinates. Optionally include any parameters that are required for customization read more about available parameters
  • Send request: Use any programming language or tool to send an HTTP request to our API endpoint. You will receive a response containing detailed information of each word with coordinates and other properties.
  • Process response: Once you have received an API response, your application can process the extracted data as you wish. The data you receive will include the word, x, y coordinates, and associated CSS properties.

Review the Exported Data: Once the extraction is complete, you will be presented with a detailed export of each word, along with its associated coordinates and CSS properties. This organized dataset simplifies further analysis or integration into your projects.

Why Use Our Extraction Tool? Precision and Exactitude: Our extraction tool has been designed to produce precise results, cohesively documenting the coordinates and CSS properties of each word.

Streamlined Efficiency: Our extraction tool provides you with precise outputs while being exponentially more efficient and allowing you time savings on a task that once required the processes of whitespace removal.

Customization Options: Tailor the extraction parameters to align with your specific needs, offering a customizable experience that caters to diverse use cases.

In summary, our API provides a powerful and efficient solution for extracting words' coordinates from websites, offering users the flexibility and control needed for seamless integration into diverse applications.

How to export words from websites with coordinates?

Step 1

Click here to create new account. You will receive 100 free requests every month.

Step 2

After register get api key from our dashboard

Step 3

Send request to our server, you will receive a json file containing all words with positions (x,y, width, height, xpath)

Loading...

Example response:

Loading...

How to extract css properties for html elements or words?

To extract css selector for html elements or words you need to render website in browser and write script to extract all data after the browser renders the page. We present a unique solution that solves this problem. Use the "Extract" method in our api and two parameters "extract_elements=1" and "extract_style=1" to export all HTML elements with their CSS properties.

When you run below command

Loading...

As response apart from the word list, you will also get all html elements with css properties. If you want to check what CSS properties a given word has, you can locate them using the "xpath" attribute.

Loading...

Click here to download example extract json file: https://webshotapi.com/static-files/example-com-extract.json

Extract_styles available properties

You have 3 available values for extract_style parameter:

  • "0" Extract only selectors with positions without css properties
  • "1" Extract primary css properties for all elements (visibility, display, fontWeight, backgroundImage, cursor, fontSize, color, position, textDecoration, text-decoration-line, backgroundColor)
  • "2" Extract all css properties for all elements (will generate big output file)
Loading...