0

Hi there Stack Overflow!

I'm attempting to copy text from a website, isolate a section of the text I want via ruby string-manipulation methods, and then paste the text into another field.

My problem is that the text is dynamically built on the website as a HTML code block rather than as text for an element. Calling .text on the element that seems to be housing the text returns blank. Thus I can not use the .text method to reference the dynamically generated text.

Please see the screenshot for an example of what I'm working with (with sensitive info blocked out, of course :-) ). I hope you can help me resolve this, I really appreciate it. this text is not present when I try to call any of the containing elements' .text attribute I would be willing to find a way to drag from one section of the text to another if that's a possible option. I'll try anything, really. Thanks a ton for any help you can provide.

Jesse Fish
  • 91
  • 1
  • 11
  • 1
    although you solved it, it's worth mentioning that you could run custom javascript on the page (through selenium's `execute_script`) that tracks which text is highlighted .. there's not a built in event for getting highlighted text but there is a workaround shown [here](https://stackoverflow.com/questions/3731328/on-text-highlight-event) – max pleaner Oct 13 '17 at 22:33

1 Answers1

0

Turns out I was just referencing the wrong element to find the text. Please ignore this ticket.

Jesse Fish
  • 91
  • 1
  • 11
  • If you don't need it any more, please delete the question. – JeffC Oct 13 '17 at 21:05
  • The only reason I'm not is because max pleaner had a great suggestion that might help other people looking into this. Thanks for keeping me on my toes regarding SO etiquette :-). – Jesse Fish Oct 17 '17 at 12:03