The most common cause for your phone or computer not scanning the WhatsApp Web QR code is that it is not connected to the internet. Another cause could be that the camera on your phone is dusty; cleaning it could help. It might also be beneficial to bring your phone closer to the QR code on your PC.
You can't use WhatsApp online on a phone with a malfunctioning camera because the camera is required to read the QR code. If you have a trusted friend, you can install a second copy of WhatsApp on their phone (link opens in a new browser tab). Then, using your phone, link your WhatsApp account to the WhatsApp web.
Download the version for your operating system from WhatsApp.com/download. Install the program in the same way you would any other Windows or Mac application. Open the application once you've finished. It will open the WhatsApp QR code in the same way as the WhatsApp site does.
Go to your phone's app store and search for WhatsApp. Then hit the three dots in the top right corner and select
WhatsApp Web.
Finally, use your phone's QR code scanner to scan the QR code on your computer's WhatsApp application. Your WhatsApp messages will be visible on your computer, and you may use the WhatsApp application on your computer to send and receive messages.