Documentation Index
Fetch the complete documentation index at: https://mintlify.com/jessebyarugaba/Unofficial-Uganda-Securities-Exhange-API/llms.txt
Use this file to discover all available pages before exploring further.
Common issues
This guide covers common issues you might encounter when using the Uganda Securities Exchange API library and their solutions.Unable to load HTML from URL
Unable to load HTML from URL
Possible causes:
- Network connectivity issues
- The target website is down or temporarily unavailable
- Server firewall blocking outbound requests
- SSL/TLS certificate issues
- Verify your internet connection is working
- Check if the USE website (https://www.use.or.ug) is accessible in your browser
- Ensure your PHP installation has
allow_url_fopenenabled in php.ini: - If using cURL, verify the
ext-curlandext-opensslextensions are installed:
No table found on the page
No table found on the page
Issue: The scraper cannot locate the expected table structure on the webpage.Possible causes:
- The website structure has changed
- JavaScript-rendered content (not accessible to PHP DOM parser)
- Incorrect selector
- Inspect the current website structure to verify the table still exists
- Check if the content requires JavaScript to load (this library only works with static HTML)
- Update your selectors if the website structure has changed
- Consider implementing error handling:
Memory limit exceeded errors
Memory limit exceeded errors
Solutions:
- Increase PHP memory limit in php.ini:
- Or set it at runtime in your script:
- Always clear DOM objects after use:
- Process data in smaller chunks when possible
Encoding and character set issues
Encoding and character set issues
Issue: Special characters or non-ASCII text appears garbled.Solutions:
- Ensure the
ext-iconvextension is installed (required dependency): - Install the optional
ext-mbstringextension for better multi-byte character support: - Verify your database and files are using UTF-8 encoding
Composer dependency installation fails
Composer dependency installation fails
Issue: Unable to install the Simple HTML DOM Parser dependency.Solutions:
- Ensure Composer is installed and up to date:
- Check PHP version meets minimum requirement (PHP >= 5.6):
- Clear Composer cache and try again:
- If behind a proxy, configure Composer proxy settings
Selectors not finding elements
Selectors not finding elements
Issue: CSS selectors return no results even though elements exist.Common mistakes:
- Using incorrect selector syntax
- Assuming JavaScript-modified DOM structure
- Whitespace or formatting differences
- Test selectors incrementally from parent to child
- View the actual HTML source (not browser inspector which may show JS-modified DOM)
- Use more flexible selectors:
- Add debugging to see what’s actually found:
PHP environment issues
The Uganda Securities Exchange API library requires specific PHP extensions and configurations.
Required extensions
Verify all required extensions are installed:ext-iconv- Character encoding conversion- PHP >= 5.6
ext-curl- HTTP requests (especially for HTTPS)ext-openssl- SSL/TLS supportext-mbstring- Multi-byte string handling
Server configuration
Ensure these php.ini settings are properly configured:Web scraping best practices
Following these practices helps prevent issues and ensures reliable operation.
Rate limiting
Implement delays between requests to avoid overwhelming the target server:Error handling
Always implement proper error handling:User agent configuration
Some websites require a valid user agent:Legal and ethical considerations
Before deploying this library in a production environment:- Review the Uganda Securities Exchange website’s terms of service
- Contact the Uganda Securities Commission for permission
- Email them explaining your intended use case
- Wait for explicit approval before proceeding
Getting help
If you continue experiencing issues:- Check the Simple HTML DOM Parser documentation
- Review the source code examples in the repository
- Enable PHP error logging to capture detailed error messages:
- Test your PHP environment configuration:
When reporting issues, include your PHP version, installed extensions, and relevant error messages.