Copy A Large Text From Chrome Browser

I need to copy a large text from Chrome Browser to a text editor (Gedit or Geany). The text contains around 40000 rows and each row looks like this:

{"source":"Twitter for iPhone","text":"RT @DonaldJTrumpJr: Trump fixed the VA after Obama-Biden left it in shambles/scandal\n\nTrump is trying to end forever wars. Biden voted for…","created_at":"Mon Sep 07 01:03:01 +0000 2020","retweet_count":22536,"favorite_count":0,"is_retweet":true,"id_str":"1302774341290078208"},

I tried many times but both Gedit and Geany did not work. I had to copy this text to my email and email it to myself. I still need to figure out how to get it from the Chrome Browser to my text editor.

In Chrome, can you not save the file as .html and then open it in gedit or your editor of choice?

I tried but it did not work. When I save the webpage as an HTML file the contents I need did not show in the file.

Hi,

Can you select the text and print PDF?

Thanks Tom.

I cannot do that. I need to analyze the data.

Could you elaborate this? I mean: what happens?
No text is pasted? Gedit crashes?

The copy seems successful because I can paste the contents to my email. When I paste the contents to Gedit and Geany, nothing happened. Is there a limit about how much text I can copy and paste in Fedora 32?

Just to have more context: paste in the Chrome browser itself (webmail), or in a client (Thunderbird, Evolution)?

1 Like

I was able to paste the contents into the webmail, not in a client. In other words, the contents do not leave the browser.

Make sure the text is copied correctly to the clipboard.

  • Try using some clipboard manager like GPaste.

  • Try copy-paste with primary selection: Ctrl+A, Middle click

this does not work. I tried the same operation on my windows machine, and it worked very well.

Is it possibly a bug on Fedora 32?

Weird.
I created a file containing 8000 lines of random words and I opened it with Chrome. And copy&paste from Chrome to Gedit works.
I created a file containing 8000 lines with the example text you wrote in the first post, and I can reproduce the fact that copy&paste from Chrome doesn’t work. Looking at gpaste history, the copied text doesn’t even go to the clipboard, and at the same time the clipboard is empty.
However copy&paste works if I open the file using Firefox.

3 Likes

Do you think this is a Chrome bug?

It’s possible.


Actually, I can reproduce the issue with Chromium Freeworld for both Wayland and Xorg.

1 Like

I would not know what is different between systems, but i am using F32, with kernel 5.8.7, gnome 3.36.6-1.fc32 gedit 2:3.36.2-1.fc32 and chrome 85.0.4183.102-1
I tried what alciregi did but used a file that I created using vim. I pasted 41,926 copies of the line posted by yifan in his first post into that file then saved it.
I then opened that file with chrome, copied the entire contents into the clipboard and pasted it into gedit which I then saved to a new file. I had no problems copying/pasting from chrome or gedit.

I wonder how much memory is installed in yifan’s and alciregi’s PCs. I have 16GB and had no problems, but I can see where inadequate memory and needing to use swap might interfere, especially when doing a copy/paste.

1 Like

My computer has got 32 GB RAM installed. So, I also reproduced @alciregi’s attempt:

  1. I copied the one line from here, opened gVim and made 40000 copies into the opened file. Then saved it without any issues. gVim was super fast in doing this.
  2. Then I opened the file in Firefox, it complained about some JSON compatibility error - it probably expected one big JSON and not 40000 small JSONs - but I could copy it and paste into Gedit with no issues. It just was not that quick as with gVim.
  3. I did the same with Chrome. Chrome did not complain about anything, but loading the file took more than a minute. Then it could be copied using the right click and Copy, but when I wanted to paste it into Gedit, there was nothing in the clipboard.

So, I can confirm that this is not a Gnome, or clipboard issues, that must be a Chrome issue. The question is, whether it might be actually a feature that protects the system from being overloaded with huge files?

According to this discussion, Clipboard setData Chrome limit - Adobe Support Community - 8281407, it seems like there is some sort of a limit in Google Chrome. Unfortunately, I have not been able to find a solution to it.

Either you can use Firefox to copy those data, because this has proven working.
Or you could download the whole page with wget or curl.

So, what is different on your system, that you can copy that chunk of files, @computersavvy ?

Here’s a way to reproduce the issue:

printf x%.s $(seq $((2**18+1))) > /tmp/x.txt; \
chromium-freeworld /tmp/x.txt

256K is not enough for anyone. :rofl: @chromium-2020

My desktop has 128 GB Ram. Does your result mean vim is more powerful than geany and vim?

1 Like