Welcome!
I can't connect it to the internet. There is no port
According to tech spec sheets sheet going back to the first G4 PowerBook, they all had a RJ-45 ethernet port.
—To which newer Macs do you have access? Our knowing the exact models may open so doors to getting the files moved. Best-case scenario would be a working Mac that still had FireWire (IEEE 1394) ports:
- Macbook Pro Mid 2012 and older
- iMac Mid 2011 and older
- Mac Mini Late 2012 and older
- All eMacs
- MacBook Mid 2009 and older
That would enable Target Disk Mode in its original version over FireWire. The drive in the PowerBook appears on the desktop of another Mac as if it were a mounted external drive. FWTDM has have pulled projects out of the fire for me on several occasions.
Transfer files between two Mac computers using target disk mode - Apple Support
Early PowerBooks had FireWire 400; later ones had FW800. You may need an adapter. The different ports tell you which you have:

—Using a bare-drive adaptor or external enclosure after removing the hard drive from the old PowerBook is always an option but not a good one. It is a non-trivial task on PowerBook G4s and early Macbook Pros. The process could render the computer useless. We are not allowed to post takeapart links here but such sites are available.
—Optical drives:
It won't accept any CD I put into it.
Symptoms please. If the drive prevents a disk from being loaded at all by blocking the slot, the drive is either DRT (dead right there) or already has a disk jammed in it. Bad.
However, if the drive fully accepts a disk, makes a few whirring noises and then spits out the disk, THAT could be a dirty drive. And possibly fixable.
Slot-load optical drives get filthy. When the lens gets gooped up, the drive rejects the disk after fully "swallowing" it.
I have resurrected "dead" optical drives in several PowerBook G4s and older Macbook Pros with a drive cleaning disk. They cost between US$5 and 15 and are usually found at office supplt stores that carry computer accessories, computer shops, and home entertainment outlets. well.
That is a cheap option. If if does not work, you are not out much money.