There has been a lot of form-filling software which is intended to cover all kinds of web forms (government forms, insurance forms, surveys, etc.) They typically use textual hints and statistically information to cover as much web pages as possible. These heuristic methods have disadvantages of making mistakes like filling a ‘first name’ field using one's full name. And they may cover some fields but not all fields in a web form. These disadvantages make them unfit for some tasks when accurate information is critical, or when fully automation is desired. The invention described herein can guarantee 100% accuracy and 100% coverage of all input fields. We do it by inspecting web pages containing web forms, case by case, and extract the form completion logic using a programming language or equivalents. Besides accuracy and coverage, this effort results in extra layer of security. E.g. a user using other form-filling software may be fooled to give their personal information to a phishing website. This is prevented with the technology described herein. This approach requires inspection and coding for each website before our technology can be applied to their website, hence it is more suitable for important or frequently used web forms.