CarlosCRO
CarlosCRO

Reputation: 33

Getting the size of a text with Selenium

So im stuck with something very basic. Im trying to determine the width of a text contained in a div with a image. The thing is, the width of the paragraph is the same as the one of the div element, but the text is wrapped in another width. Is there any option to get the width I want.

This is the width of the paragraph:enter image description here

But the width I want is something like this: enter image description here

The page of reference is this one: https://wikifaunia.com/aves/como-cuidar-a-un-agaporni/

Thanks in advance

Upvotes: 0

Views: 187

Answers (1)

Christophe Gibelli
Christophe Gibelli

Reputation: 36

i think you can with just math.

  • The total width of the div (text with the image) is : 787px
  • The with of the image is 300px and your have a margin left of 30px so the total is 330px.

So 787 - 330 = 457.

Your text width is 457px.

Upvotes: 1

Related Questions